Copy link to clipboard
Copied
Hi All,
I need to arrange a rectangle path item to "Send to Back" in the document using script.
Kindly reply me to on how to send it back.
Thanks.
If the rectangle is selected and you don't want to mess with a PageItem.zOrderPosition via zOrder() command:
app.executeMenuCommand("sendToBack")
Otherwise:
PageItem.zOrder(ZOrderMethod.SENDTOBACK);
// as in:
var target = app.selection[0];
target.zOrder(ZOrderMethod.SENDTOBACK);
Copy link to clipboard
Copied
If the rectangle is selected and you don't want to mess with a PageItem.zOrderPosition via zOrder() command:
app.executeMenuCommand("sendToBack")
Otherwise:
PageItem.zOrder(ZOrderMethod.SENDTOBACK);
// as in:
var target = app.selection[0];
target.zOrder(ZOrderMethod.SENDTOBACK);
Copy link to clipboard
Copied
Thank you so much..
Copy link to clipboard
Copied
What happens if you use zOrder and there's a selection? Does it crash or something?
Copy link to clipboard
Copied
I am using Illustrator CC2018 on Mac. No issues with this version. Is there any issues while we use a lower version of Illustrator?
Copy link to clipboard
Copied
I use "move" method to do this. I can move an element (selected or not) within the same or different container: