2 Replies Latest reply on Sep 28, 2015 4:42 AM by SangeethaRajeshkumar

    Library item layer

    SangeethaRajeshkumar

      Hi Friends

       

      I want to change the layer of Library item. When i drag and drop client supplied library files into indesign document, automatically it comes in Layer1. But we need in "anno" Layer.

       

      Please guide me how to do this in scripting.

       

      Thanks,

      Sangeetha

        • 1. Re: Library item layer
          Vel Prakash Level 1

          Hi Sangeetha,

           

          While placing the library asset in InDesign, try mentioning the layer which you would like to place in parameters.

           

          Or Else try applying layer after placing, with code like below.

           

          app.selection[0].itemLayer = app.activeDocument.layers.item('anno');

           

           

          It would be better if you share what code you have now. And the devlopers here will correct it accordingly.

           

          Regards,

          Velprakash.

          • 2. Re: Library item layer
            SangeethaRajeshkumar Level 1

            Hi Velprakash

             

            Sorry for the late reply and Thanks for your support.Now working fine.

             

            Here is the code for your reference

             

                                var doc = app.activeDocument;    

                                placedAsset = libAsset.placeAsset ( doc ); 

                                placedAsset = placedAsset[0]; 

                             

                               

                                var theLayer = myDocument.layers.item("Anno");

                                placedAsset.itemLayer = theLayer;   

                                   

                                libAsset.remove(); 

                                lib.store ( placedAsset, {name:assetName} ); 

                                placedAsset.remove(); 

             

            Thanks

            Sangeetha