3 Replies Latest reply on Oct 24, 2013 4:50 AM by Statixx91

    [JS] [Win7] [CS5] Moving pages to another document

    Statixx91

      Hi guys,

       

      I need to write a script for my company which merges 3 documents together by selecting the needed pages in two of three documents and moving them to the third document. Everything works fine and I am almost finished but I can't find a way to move pages between documents.

      I also thought about just copying everything on the needed pages but this doesn't work because every document has different master pages which are needed.

       

       

      Is somebody able to help me with the needed code to select some Pages and move them to the end of another document?

      Any help would be greatly appreciated.

       

       

       

      Statixx91

        • 1. Re: [JS] [Win7] [CS5] Moving pages to another document
          Jump_Over Level 5

          Statixx91 wrote:

           

          ...

          Everything works fine and I am almost finished but I can't find a way to move pages between documents. I also thought about just copying everything on the needed pages but this doesn't work because every document has different master pages which are needed.

          ...

           

          With no pages moved and no pageItems covered - where is the point which you called "almost finish"?

           

          Example:

          (with 2 documents opened - last opened index = 0)

          var tarPage = app.documents[0].pages[0];
          app.documents[1].pages[0].duplicate(LocationOptions.AFTER, tarPage);
          

           

          It duplicates 1st page of 1st doc after 1st page od 2nd doc. Move() method work similar.

          In case of masterPages you can move them as well but this is an open gate to another story, I am afraid.

           

          Jarek

          • 2. Re: [JS] [Win7] [CS5] Moving pages to another document
            Laubender Adobe Community Professional & MVP

            In case of masterPages you can move them as well but this is an open gate to another story, I am afraid.

            Oh my…
            Yes.

             

            Uwe

            • 3. Re: [JS] [Win7] [CS5] Moving pages to another document
              Statixx91 Level 1

              The script automatically opens all needed documents, deletes unneccessary pages, starts another script, saves the main document and exports a PDF at the end. Now, with your help, it also adds all the needed pages into the main document. That's why I said it was almost finished

               

               

              Thank you very, very much for your help. I edited your code to fit my needs and everything works just great.

               

              Statixx91