【发布时间】:2014-06-24 19:19:09
【问题描述】:
(我是一个真正的新手)我能够通过从其他帖子中挑选一些内容来创建一个苹果脚本。此脚本使用 acrobat pro 11 引擎从文件夹中批量打印 PDF,并在完成后将它们移动到单独的文件夹中......虽然该脚本在固定桌面路径的一台计算机上运行良好。它必须针对我们使用的每台不同的计算机进行修改。有没有办法在变量位置编写监视文件夹的脚本?
property myFolder : "HD:Users:User:desktop:Print:"
set myfiles to list folder myFolder without invisibles
repeat with myfile in myfiles
set mycurrentfile to ((myFolder as string) & (myfile as string)) as string
batchprint(mycurrentfile)
end repeat
on batchprint(mycurrentfile)
tell application "Adobe Acrobat Pro"
activate -- bring up acrobat
open alias mycurrentfile -- acrobat opens that new file
tell application "System Events"
tell process "Acrobat"
click menu item "Print..." of menu 1 of menu bar item "File" of menu bar 1
click button "Print" of window "Print"
tell application "System Events"
tell process "Acrobat"
click menu item "Close" of menu 1 of menu bar item "File" of menu bar 1
end tell
end tell
end tell
end tell
end tell
tell application "Finder" -- to move the printed file out
set x to (("HD:Users:User:desktop:Printed PDFs") as text)
if alias x exists then
beep
else
make new folder at the desktop with properties {name:"Printed PDFs"}
end if
move alias mycurrentfile to folder "Printed PDFs"
end tell
end batchprint
【问题讨论】:
标签: pdf applescript acrobat