【发布时间】:2021-12-26 07:05:09
【问题描述】:
我正在尝试在 Automator 中构建一个可以在任何文件夹上运行的快速操作,它将在该文件夹内的每个 .pdf 文件上逐个运行以下 AppleScript - 等待第一个完成,然后再开始下一个文件。
目前我只有想要运行的 AppleScript 代码,但我不知道如何将其附加到快速操作并使其在内部的每个 pdf 项目上运行代码。
注意:文件夹中PDF文件的数量每次可以不同。
on run {input, parameters}
set theFile to input's item 1
set theSeconds to time of (current date)
tell application "Finder"
set theDuplicate to duplicate file "Macintosh HD:Users:username:Documents:IddTest:template.indd"
end tell
tell application "Adobe InDesign 2020" to open file (theDuplicate as string)
tell application "Adobe InDesign 2020"
if document 1 exists then
repeat 34 times
tell document 1
relink link "placeholder.pdf" to theFile
try
update link "placeholder.pdf"
end try
end tell
end repeat
end if
close document 1 saving yes
end tell
tell application "Finder"
set name of theDuplicate to "" & theSeconds & ".indd"
end tell
end run
【问题讨论】:
标签: applescript automator