-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathSkew Frame.js
37 lines (29 loc) · 933 Bytes
/
Skew Frame.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// ----------- Skew Frame ----------- //
/*
Increments the Rotation and Shear X Angle of a text frame by the same amount
*/
var skewFactor = 1; // change this number to increase/decrease the amount the text frame is skewed by
var doc = app.activeDocument;
function main() {
var hasErrors = false,
selections = app.selection;
for (var i = 0; i < selections.length && !hasErrors; i++) {
var textFrame = selections[i];
var frameHasErrors = isError(textFrame);
hasErrors = hasErrors || frameHasErrors;
if (!frameHasErrors) {
textFrame.absoluteRotationAngle += skewFactor;
textFrame.absoluteShearAngle += skewFactor;
};
}
if (hasErrors) {
alert('Some selections were not text frames and were skipped');
}
}
function isError(obj) {
if (!(obj instanceof TextFrame)) {
return true;
}
return false;
}
main();