我编写脚本以使用applescript将xls转换为pdf。 这是我的代码:
set the_file to (choose file)
tell application "Preview"
activate
open the_file
end tell
tell application "System Events"
tell process "Preview"
keystroke "p" with command down
tell front window
UI elements
end tell
end tell
end tell
当我运行脚本时,我有错误
keystroke "p" with command down
怎么了?
答案 0 :(得分:0)
您需要关键字using
而不是关键字with
。所以,错误的行应该是:
keystroke "p" using command down