0
我正在使用第三方應用程序將圖像複製到剪貼板。然後,我想執行一個打開Preview的AppleScript,創建一個新文檔,然後使用剪貼板作爲內容,然後將其保存到指定的位置。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
我無法找到正確的語法,用於保存預覽文件。這將是當時唯一開放的文件。