0

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 “"”.
Jongware
  • 22,200
  • 8
  • 54
  • 100
Matt
  • 137
  • 2
  • 14

2 Answers2

3

InDesign doesn't understand "every file of folder". The expression you are using is something you would say to the Finder.

matt
  • 515,959
  • 87
  • 875
  • 1,141
3

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.

Jongware
  • 22,200
  • 8
  • 54
  • 100
vadian
  • 274,689
  • 30
  • 353
  • 361