I’ve got a strange problem. I need to scan thru a bunch of folders looking for InDesign files, then open each up and save them out again, overwriting the original file (I’m doing this because I have a third-party InDesign plug-in which writes a special thumbnail to the file upon saving which displays on our DAM system).
Here’s the code I have at the moment:
set inputFolder to choose folder display dialog "This script will open and save all InDesign files in the specified folder." tell application "Finder" set newFiles to (every file of entire contents of inputFolder whose name extension is "indd") as list set fileNum to (count of newFiles) end tell set i to 1 repeat while i is less than fileNum set filePath to (item i of newFiles) as text display dialog filePath tell application "Adobe InDesign CS5.5" set user interaction level of script preferences to never interact open item i of newFiles tell active document to save saving in filePath close active document set i to i + 1 set user interaction level of script preferences to interact with all end tell end repeat
I can’t get it to overwrite the original. I keep getting errors like:
error “Can’t get saving of "Macintosh HD:Users:jonathanhodges:Desktop:UBS_Collect_Samples:UBZ2169 HumanitarianBrochure:Comp:UBZ2169Envelope.indd".” number -1728 from saving of “Macintosh HD:Users:jonathanhodges:Desktop:UBS_Collect_Samples:UBZ2169 HumanitarianBrochure:Comp:UBZ2169Envelope.indd”
Tried changing filePath to an alias instead of text and that didn’t work. Tried the force save boolean. The problem seems that since there are no modifications to the file at the time of the save, it wants to do a save as and give me a dialog box which I don’t want.
Anyone have any ideas? Thanks.