Matt Matt - 3 months ago 12
AppleScript Question

Applescript to open all InDesign files in a folder

I am trying to make a script which opens all InDesign files in a folder and edits them.

Currently trying to open the files, here is what I have:

tell application "Adobe InDesign CC 2015"
open (every file of folder "test1" whose name ends with ".indd")
end tell


but I get a snytax error:

Expected “,” but found “"”.

Answer

InDesign has no idea at all what files and folders are.

Only the Finder (and System Events) have knowledge about the file system

tell application "Finder" to set indesignFiles to (files of folder "test1" whose name extension is "indd") as alias list

tell application "Adobe InDesign CC 2015"
    open indesignFiles
end tell

Consider that in the Finder the folder test1 is a subfolder of the desktop folder.

Comments