Last active
August 29, 2015 14:21
-
-
Save jadnco/d8c06a8248c32738c490 to your computer and use it in GitHub Desktop.
A Sketch plugin that lets you create and specify how many duplicates of a layer you want.
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 input = [doc askForUserInput:"Total copies:" initialValue:'']); | |
| var count = parseInt(input); | |
| var quit = input == null; | |
| while (count != count) { | |
| if (quit) break; | |
| input = [doc askForUserInput:"Please enter an actual number for copies:" initialValue:'']; | |
| quit = input == null; | |
| count = parseInt(input); | |
| } | |
| if (!quit) { | |
| for (var i=0; i<selection.count(); i++) { | |
| var layer = selection[i]; | |
| for (var j=0; j<count-1; j++) { | |
| layer.duplicate() | |
| } | |
| print(layer); | |
| } | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to install
.tarfile it downloaded.sketch-duplicate.sketchpluginto~/Library/Application Support/com.bohemiancoding.sketch3/PluginsUsing the plugin
Plugins > sketch-duplicateand specify the total layer count you want.