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); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to install
.tar
file it downloaded.sketch-duplicate.sketchplugin
to~/Library/Application Support/com.bohemiancoding.sketch3/Plugins
Using the plugin
Plugins > sketch-duplicate
and specify the total layer count you want.