Skip to content

Instantly share code, notes, and snippets.

@mburger89
Forked from sojack/duplicate.jsx
Created May 30, 2016 05:15
Show Gist options
  • Save mburger89/354e6c27f2b03b94e0ffdd5d9354a7c8 to your computer and use it in GitHub Desktop.
Save mburger89/354e6c27f2b03b94e0ffdd5d9354a7c8 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