【发布时间】:2018-07-12 02:53:32
【问题描述】:
我正在使用第三方应用程序将图像复制到剪贴板。然后我想执行一个 AppleScript 打开预览,创建一个新文档,然后将剪贴板用作内容,然后将其保存到指定位置。
我已经完成了 99% 的任务 - 只是无法保存文档。我在 OS X 10.9.5 上。
到目前为止,这是我的脚本:
set the save_location to the quoted form of "/Users/freddy/Documents/test.png"
tell application "Preview"
activate
end tell
tell application "System Events"
tell process "Preview"
keystroke "n" using {command down}
end tell
end tell
tell application "Preview"
activate
save front document as "PNG" in POSIX file save_location
end tell
我找不到保存预览文档的正确语法。这将是当时唯一打开的文档。
【问题讨论】:
标签: applescript