Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

Script for copying one IND page to another document

Return to Member Forum

  • Author
    Posts
    • #54153
      Anonymous
      Inactive

      Hello all! I am trying to automate a process and I need to copy two pages from one IND document into a separate IND document using a script. I am considering to place a text label on the page in the pasteboard (because the pages could shuffle and I need some way for the script to know where the page is at without my looking) and then export that page to a pdf and then import it to a specific location in the second IND document. It might be easier to just copy the contents of the page. I am a beginning ind scripter and I have not much of an idea where to begin. Can anyone please offer some clues or advice, or even sample scripts? Thank you!

      -BGM

    • #93616
      Anonymous
      Inactive

      You can easily copy two pages from one IND document into a separate IND document using a customized script.If you have any queries regarding this issue you can ping me I ll say you how to do it in a right way

    • #93671
      Peter Kahrel
      Participant

      There is no need to export the page and place it elsewhere, you can simply duplicate a page to another document. Open the ESTK (ExtendScript ToolKit), Adobe’s script editor. If you don’t know how this works, see Help > JavaScript Tools Guide CC for an overview. Browsing InDesign’s object model, check whether the Page object has what you’re looking for
      : select your InDesign version under ‘Browser’, in the Classes’ panel, select Page. Then in the Properties and Methods panel, browse through the list. eventually you’ll find ‘move (to, reference, binding): Page’.

      This is how you use that function: assume that you want to duplicate the first page of the active document after the third page of a document named ‘immigration.indd’ (which must be open). This one-line script does that:

      app.activeDocument.pages[0].duplicate (LocationOptions.AFTER, app.documents.item(‘immigration.indd’).pages[2]);

      Concretely, you’d do this. You mentioned labelling your page. You can do that by placing a tiny text frame (or a rectangle, graphic line, any page item) on the page and name it on the Layers panel. Call it e.g. ’emigrate’. That makes it very easy to find. Then duplicate the page on which the frame sits to the other document. This two-line script does that:

      myPage = app.activeDocument.pageItems.item(’emigrate’).parentPage;
      myPage.duplicate (LocationOptions.AFTER, app.documents.item(‘immigration.indd’).pages[2]);

      This is a working script. You should add some error checking, but this is all you need.

      Well, it could be. Is there any special reason why you want to export to PDF and place that PDF in the target document?

      P.

    • #93672
      Peter Kahrel
      Participant

      Only now do I see that the original question was posted eight years ago. Duh!, as they say.

    • #93680

      Aha! Never too late! =D

      (^/)

    • #14323325

      How to duplicate the entire document? After completing the duplication we must display the details of the duplicated document. Please suggest some script to complete this particular action……

Viewing 5 reply threads
  • You must be logged in to reply to this topic.
Forum Ads