2 Replies Latest reply on Aug 31, 2009 9:25 AM by AdobeScripts

    extract Indesign pages

    johanwieland Level 1

      Hi,

       

      we are trying to split  multipage Indesign Documents to new Indesign document, each containing  one page of the original

      this in now done manually, but we wan't to automate this via a Javascript.

      second problem is, that the new documents should contain the same layers as in the original

      But in the  function list of Indesign we doesn't see anything what makes this possible.

       

       

      does anybody know if this can be done with javacripting in Indesign CS3 or CS4?

      and some hints with this,

       

      thanks in advance,

       

      Johan

        • 1. Re: extract Indesign pages
          mmsidon

          Hi Johan,

           

          sure it can be done by scripting.

           

          You have to iterate through the pages, on each page you have to iterate through the layers and there you can duplicate each "pageItem" in "pageItems" into a new document. Formats are automatically duplicated as well so you don't have to care about them.

           

          The only thing you have to handle with care are chained textframes....

          You will have chain again the two textframes on the same page and you will have to separate the two textframes if they are on different pages...

           

          Greetings,

          Marc

          • 2. Re: extract Indesign pages
            AdobeScripts Level 3

            hi Johan

             

            you need to create new document with one page and size like in original document and then you need to duplicate page from this original document to new document at end - then delete first page

            and do this for each page you want to duplicate

            all links between TextFrames on moved page will remain unchanged

             

            VB example for one page

             

            Dim myDoc1 As InDesign.Document

            Dim myDoc2 As InDesign.Document


            Set myInDi = CreateObject("InDesign.Application.CS3")
            Set myDoc1 = myInDi.Documents.Item(1)

            Set myDoc2 = myInDi.Documents.Item(2)


            Call myDoc1.Pages.Item(1).Duplicate(, myDoc2.Pages.Item(-1))

             

            robin

             

            www.adobescripts.co.uk