-
-
Save mburger89/354e6c27f2b03b94e0ffdd5d9354a7c8 to your computer and use it in GitHub Desktop.
Illustrator Object Duplicator
This file contains 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
if (app.selection[0] != null) { | |
var myDoc = app.activeDocument, | |
selectedArt = myDoc.selection[0], | |
dupNumber = 3, // set number of duplicates | |
horOffset = 10, // set horizontal offset | |
verOffset = 10, // set vertical offset | |
myDuplicate, | |
i = 0; | |
for (i;i < dupNumber; i++){ | |
myDuplicate = selectedArt.duplicate(); | |
myDuplicate.position = [selectedArt.position[0] + horOffset * (i + 1), selectedArt.position[1] + verOffset * (i + 1)]; | |
} | |
} | |
else { | |
alert("You must have the object you want to duplicate selected."); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment