9 Replies Latest reply on Feb 10, 2016 4:16 AM by Elmnas

    copy content to another document certain layer

    Elmnas

      Hello people I have made following code,

       

      its a batch script

      I want to copy all content from a document to another.

       

      My issue is to activate a certain layer

       

      Could someone help me?

       

       

      see code here

      [code]

      //textLayer= app.activeDocument.layers.add ({name: "TT_IDML"});

      var docSource=app.activeDocument;

       

      var myFolder = Folder.selectDialog("Choose the folder")

       

      if(myFolder.length==0)

      {

          alert("No Folder Selected")

          exit(0)

          }

       

       

      var myFiles = myFolder.getFiles("*.idml")

       

      if(myFiles.length==0)

      {

          alert("No InDesign files in folder")

          }

       

       

      for(i=0; i<myFiles.length; i++)

      {

       

          myFile = myFiles[i]

      //    alert(myFile)  

          app.open(myFile)

       

       

      var docTarget=app.activeDocument;

       

      var paletteObjects = app.activeDocument.layers[0].allPageItems;

      app.select(paletteObjects);

      app.copy();

       

      app.activeDocument=docSource;

      app.documents[0].layers.itemByName("TT_IDML").select;

       

       

       

       

          // app.pasteInPlace()

       

        

          }

       

      [/code]

       

       

       

      thank you in advance