10 Replies Latest reply on Jun 27, 2012 7:17 AM by absqua

    Loop multiple data files and save-as for each


      Here is what i am trying to do, I have a base Indesign CS5.5 file that we will call the master file.  I have multiple tab-delimited text data files that contain a SearchFor and ReplaceWith columns.  I've got the script working so that I can pick 1 text file and it runs through the InDesign file and makes all the changes based on the text file.  What I need for the script to do it be able to do, is instead of prompting for 1 text file:


      1. it prompt for a folder that contains all my text files

      2. Starts with the first text file and does the FindReplace I already have working based off the master Indesign file.

      3. Upon completion of the first text file, do a save-as of the updated Indesign file with changes made.

      4. Master Indesign file reverts back to original state, minus changes made so it's ready for the next text file.

      5. Move to the next text file and bounce the Find/Replace off of the original master Indesign file.


      And then basically steps 3-5 loop through until all the text files have been processed.


      Like I said, I have it doing the process for one file at a time, I just need to make it so that it can run through a batch of them without someone needing to babysit it.