Open All Files one by one

Viewing 3 reply threads
  • Author
    Posts
    • #1229945

      Hi All,
      Greetings.

      I have written a script, which works in one .indd file. I have 100s of .indd files, in which I have to run this particular script once. I want to automate this too. The steps are as follows.

      1) Open first X.indd file in a particular folder or directory.
      2) Run the script.
      3) Save and close the .indd file with a X_Script_Applied.indd name.
      4) Repeat step 1 with the 2nd file in the directory.

      How to do this?
      Thanks in advance

    • #12300435
      Brian Pifer
      Participant

      Use the Folder object:

      var fol = Folder(“some/path”);
      var inddFiles = fol.getFiles(“*.indd”);
      for (var i = 0; i < inddFiles.length; i++) {
      var doc = app.open(inddFiles[i]);
      //do stuff
      }

    • #12433010

      Thank you Very much Brian.

    • #12433041
      Masood Ahmad
      Participant

      You can also use the BatchScript to run another script on all the InDesign files within a folder.

      Try that as well…

Viewing 3 reply threads
  • You must be logged in to reply to this topic.
>