Skip to content

Instantly share code, notes, and snippets.

@sojack
Created November 4, 2011 13:41
Show Gist options
  • Save sojack/1339340 to your computer and use it in GitHub Desktop.
Save sojack/1339340 to your computer and use it in GitHub Desktop.
Illustrator Object Duplicator
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