Applescript打开文件夹中的所有InDesign文件

时间:2016-08-21 20:26:17

标签: applescript adobe-indesign finder

我正在尝试创建一个脚本,打开文件夹中的所有InDesign文件并对其进行编辑。

目前正在尝试打开文件,这就是我所拥有的:

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

但是我收到了一个snytax错误:

 Expected “,” but found “"”.

2 个答案:

答案 0 :(得分:3)

InDesign并不了解"文件夹"的每个文件。您正在使用的表达式是您对 Finder 所说的内容。

答案 1 :(得分:3)

InDesign根本不知道哪些文件和文件夹。

只有Finder(和System Events)了解文件系统

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

请注意,Finder文件夹test1是桌面文件夹的子文件夹。

相关问题