File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ // Change Selected Layers' Font Size (cmd shift t)
2
+ // This plugin will change the font size of all the text layers in the selection.
3
+ // If the selection is mixed (i.e: shapes and text layers) only text layers will be
4
+ // affected, and the selection will be modified when running the command, so only
5
+ // text layers will remain selected after running it.
6
+
7
+ var textLayers = []
8
+
9
+ for (var i=0; i < [selection count]; i++) {
10
+ var layer = [selection objectAtIndex:i]
11
+ if ([layer isKindOfClass:[MSTextLayer class]]) {
12
+ textLayers.push(layer)
13
+ }
14
+ }
15
+
16
+ if (textLayers.length == 0) {
17
+ [doc showMessage:"You need to select at least one text layer"]
18
+ } else {
19
+ var size = [doc askForUserInput:"Font Size for selected layers?" initialValue:16]
20
+ for (var i=0; i < textLayers.length; i++) {
21
+ var textLayer = textLayers[i]
22
+ [textLayer setFontSize:size]
23
+ }
24
+ [[doc currentPage] deselectAllLayers]
25
+ for(var i=0; i < textLayers.length; i++){
26
+ var layer = textLayers[i]
27
+ [layer select:true byExpandingSelection:true]
28
+ }
29
+ }
You can’t perform that action at this time.
0 commit comments