Skip to main content
Inspiring
January 22, 2021
Answered

How to arrange path item "Send to Back" in illustrator using extendscript?

  • January 22, 2021
  • 2 replies
  • 1267 views

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.

 

 

This topic has been closed for replies.
Correct answer Inventsable

 

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);

2 replies

rcraighead
Legend
January 24, 2021

I use "move" method to do this. I can move an element (selected or not) within the same or different container:

FP_Group.move(myLayer, ElementPlacement.PLACEATEND);
myPrint.move(FP_Group, ElementPlacement.PLACEATBEGINNING);
Inventsable
InventsableCorrect answer
Legend
January 22, 2021

 

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);
durai0607Author
Inspiring
January 22, 2021

Thank you so much..