Skip to main content
Inspiring
June 24, 2010
Question

Change layer's order InDesign CS4 js

  • June 24, 2010
  • 1 reply
  • 1886 views

Hi, I need to move layer below another layer and what I tried doesn't work:

myDoc.layers.item("INSTRUCTIONS (TURN OFF)").move (locationOptions.AFTER(myDoc.layers.item ("Die")));

Thank you for your help.

Yulia

This topic has been closed for replies.

1 reply

John Hawkinson
Inspiring
June 24, 2010

You seem to have the syntax wrong:

myDoc.layers.item("INSTRUCTIONS (TURN OFF)").
move(locationOptions.AFTER(myDoc.layers.item("Die")));

locationOptions.AFTER is a constant, it is not a parametrized function. I don't have the syntax of the move() method in front of me [gasp!...], but I believe it it takes two parameters ,the locationOption and the destination [maybe the other order], so it should be:

move(locationOptions.AFTER,myDoc.layers.item("Die"))

or somesuch.

YuliaartAuthor
Inspiring
June 24, 2010

Oh, thank you, John. You were almost there: your line did work after I capitalized 'LocationOptions':

myDoc.layers.item("INSTRUCTIONS (TURN OFF)").move(LocationOptions.AFTER, myDoc.layers.item("Die"));

Thank you very much.

Yulia