1 Reply Latest reply on Nov 10, 2010 1:27 PM by Muppet Mark-QAl63s

    Activating More Than One InDesign Document

    jo2mendoza

      I need some assistance in AppleScript for InDesign CS2.

       

      I need to copy text from one InDesign CS2 document to another InDesign CS2 document. I already know the AppleScript commands to copy and paste the text.

       

      But what I am getting stuck is the command to activate the second document. After I copy the item from document 1, I need to paste it in document 2. But I don't know the command to activate the other document. I was hoping a simple command like:

      "activate lower document" or

      "activate other document" or

      "activate second document" or

      "activate document 'Untitled-2'...

       

      would work, but all of the above give me errors or do not work.

       

      Any suggestions will be appreciated.

        • 1. Re: Activating More Than One InDesign Document
          Muppet Mark-QAl63s Level 4

          You have a list of documents but there is only the one active document. So just loop thru the others setting them to the active one in turn…

          Something like:

           

          tell application "Adobe InDesign CS2"

          tell the active document

          -- do your copy stuff here…

          display dialog (name as text) giving up after 2

          end tell

          repeat with i from 2 to count of documents

          set the active document to document i

          tell the active document

          --do your paste stuff here…

          display dialog (name as text) giving up after 2

          end tell

          end repeat

          end tell