Last active
September 21, 2017 17:46
-
-
Save sonburn/3040f0308c4cda0b2a7c66f63068cb0c 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 selections = context.selection, | |
| loop = selections.objectEnumerator(), | |
| selection; | |
| while (selection = loop.nextObject()) { | |
| var rectangle = MSRectangleShape.new(); | |
| rectangle.frame().x = selection.frame().x(); | |
| rectangle.frame().y = selection.frame().y(); | |
| rectangle.frame().width = selection.frame().width(); | |
| rectangle.frame().height = selection.frame().height(); | |
| var rectangleGroup = MSShapeGroup.shapeWithPath(rectangle); | |
| selection.parentForInsertingLayers().addLayers([rectangleGroup]); | |
| selection.removeFromParent(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment