2 Replies Latest reply on Jun 23, 2010 8:43 PM by Yuliaart

    Change layer's order   InDesign CS4 js

    Yuliaart Level 1

      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

        • 1. Re: Change layer's order   InDesign CS4 js
          John Hawkinson Level 5

          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.

          • 2. Re: Change layer's order   InDesign CS4 js
            Yuliaart Level 1

            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