Last active
August 29, 2015 14:19
-
-
Save getflourish/7bde0f365601e552163a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var doc = context.document; | |
| var layer = context.selection[0] | |
| var style = layer.style().textStyle() | |
| var scope = context.document.currentPage().children(); | |
| selectLayersByTextStyle(style, scope) | |
| function selectLayersByTextStyle(textStyle, scope) { | |
| var predicate = NSPredicate.predicateWithFormat("(style.textStyle != NULL) && (style.textStyle isEqualForSync:%@)", textStyle); | |
| // query page layers | |
| var queryResult = scope.filteredArrayUsingPredicate(predicate); | |
| // select all results | |
| doc.currentPage().selectLayers(queryResult); | |
| return queryResult; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment