Skip to main content
Known Participant
June 4, 2015
Answered

Script Save As on Multiple files without user interaction

  • June 4, 2015
  • 4 replies
  • 1150 views

W have many InDesign files in a single folder. I need to open all the files and do a Save As - not a Save - on them and replace the files in their original location I found the following script which does the save process, but I am unsure how to change this to do a Save as instead. Any help is appreciated.

tell application "Finder"

  set myInFolder to choose folder with prompt "Select a folder"

  set myFilelist to files in myInFolder whose name ends with ".indd"

end tell

tell application "Adobe InDesign CC"

  set user interaction level of script preferences to never interact

  repeat with myDoc from (count myFilelist) to 1 by -1

  set myCurrentFile to item myDoc of myFilelist

  open myCurrentFile

  set myCurDocument to active document

  tell myCurDocument

  close (save)

  end tell

  end repeat

  set user interaction level of script preferences to interact with all

  beep 3

  display alert "Finished!"

end tell

This topic has been closed for replies.
Correct answer Vamitul

Peter Kahrel's script does that and more:

Free script Batch convert/export InDesign documents | Peter Kahrel

4 replies

Known Participant
June 11, 2015

I didn't mark any one answer as correct as it would depend on your project as to what works best for the individual. After trying all the above options, for our purposes the Resave files script -- version 2 seemed to work best, requiring no user interaction during the process once the folder to be processed was selected.

While the Free script Batch convert/export InDesign documents l worked, it required a bit of user interaction when pictures were missing or modified. For what we were doing we weren't concerned with the images. It required that someone be there the entire time to click through those messages though. (Maybe I missed a setting that avoided this? It does have many options available.) It is a pretty robust script though and I could see other uses for it.

The modification to the script I'd originally found worked as well, but it took more than twice as long to process the same files as it actually displayed each ad as it went through the folder. Probably a way around that, but with my limited scripting abilities I don't know how to avoid that.

So for anyone looking for a similar script, these are all workable options, just depends on what your goals are in using them.

I appreciate all the suggestions from everyone, they were all helpful and it's always good to know there is more than one way to do something! Thanks for the help and suggestions!

Vamitul
Legend
June 12, 2015

Please do mark the solution that worked for you, or even your own reply. In the end it will help others with similar problems more, knowing that a solution, or multiple ones exists.

Kasyan Servetsky
Legend
June 5, 2015

tell application "Finder"

       set myInFolder to choose folder with prompt "Select a folder"

       set myFilelist to files in myInFolder whose name ends with ".indd"

end tell

tell application "Adobe InDesign CC 2014"

       set user interaction level of script preferences to never interact

       repeat with myDoc from (count myFilelist) to 1 by -1

              set myCurrentFile to item myDoc of myFilelist

              open myCurrentFile

              set myCurDocument to active document

              tell myCurDocument

                     set myFullName to full name of myCurDocument

                     save to myFullName

                     close

              end tell

       end repeat

       set user interaction level of script preferences to interact with all

       beep 3

       display alert "Finished!"

end tell

Known Participant
June 10, 2015

Thanks Kasyan! I'm giving all the options a chance to see which works best for us. I see what you added to the script and how it is overwriting the original file, that helps me to understand scripting better. I'm trying to learn, but I'm a slow learner. Will also try the resave files script you suggested.

Kasyan Servetsky
Legend
June 5, 2015

Check out Resave files script -- version 2

Vamitul
VamitulCorrect answer
Legend
June 5, 2015
Known Participant
June 10, 2015

Thanks Vamitul ! I will give this a try today and see if it works for us.