2 Replies Latest reply on Dec 5, 2012 1:25 AM by indegn5

    Help!!!! to Merge infinite layers to single layer

    indegn5 Level 1

      Hi everybody,

       

       

      i have this script for merging layers "only 2 layers will be merged... adding layer A & layer B", which is also found in indesign scripting guide.

       

      I am trying to merge the infinity layers inside document to single layer.

       

      can any one tweak this script, as per my request.

       

       

       

      main();

      function main(){

                mySetup();

                mySnippet();

                myTeardown();

      }

      function mySetup(){

                var myDocument = app.documents.add();

                myDocument.layers.add();

      }

      function mySnippet(){

          var myDocument = app.documents.item(0);

                //<fragment>

                //Given a document "myDocument" containing at least two layers...

                var myLayerA = myDocument.layers.item(0);

                var myLayerB = myDocument.layers.item(1);

                myLayerA.merge(myLayerB);

                //</fragment>

       

       

      I tweaked like this.... script runs without error but no result,,, leaving the layers unmerged...

       

      main();

      function main(){

                mySetup();

                mySnippet();

                myTeardown();

      }

      function mySetup(){

                var myDocument = app.documents.add();

      }

      function mySnippet(){

          var myDocument = app.documents.item(0);

       

                //Given a document "myDocument" containing infinity layers...

                var myLayers = myDocument.activeLayer.everyItem();

                myLayers.merge;

       

      }

      function myTeardown(){

      }

       

      thanks

      babylon.