9 Replies Latest reply on Jun 26, 2015 10:15 PM by Vel Prakash

    How to get the content of another file and paste into the active document in the place of certain string?

    vidhyar34646163 Level 1

      I'm newbie in indesign scripting stuffs.So I apologise as I couldn't post my trials.

      Objective:
      I have an indd document which will have figure caption,label etc. I need to copy content(figure which is editable) from other indd file to this document where related figure label exists.

      For example:
      sample.indd

      Some text Fig.1.1 caption some text 

      I need to copy the content of figure1.indd and paste into the sample.indd document where Fig.1.1string exists and so on. Now I'm doing it manually. But am supposed to automate this.

      So, I need some hint how to acheive it using extendscript?

      I have found something like below to do this, but I don't have any clue to develop it further and also am not sure whether this approach is correct to get my result. Pls help me

      myDocument=app.open(File("file.indd"),false); //opening a file to get the content without showing.

      myDocument.pages.item(0).textFrames.item(0).contents="some text"; //here I could set the content but I don't knw how to get the content

      // ?????? Then I have to paste the content into active document.