【发布时间】:2016-01-21 20:58:45
【问题描述】:
我有一个 AppleScript 可以打开将 Safari 网页移动到阅读器视图,然后另存为 PDF。
我希望它以默认文件名另存为 PDF,但始终位于相同的特定位置。我不知道该怎么做。
目前 AppleScript 的运行方式为:
tell application "System Events"
tell application process "Safari"
set frontmost to true
repeat until window 1 exists
end repeat
# Render page in Safari Reader
keystroke "r" using {command down, shift down}
delay 0.02
-- Print; wait until the sheet is visible
click menu item "Print…" of menu 1 of menu bar item "File" of menu bar 1
repeat until sheet 1 of window 1 exists
end repeat
set thePopUp to first pop up button of sheet 1 of window 1 whose description is "Presets"
click thePopUp
click menu item "Default Settings" of menu 1 of thePopUp --replace if desired with your preferred preset
click menu button "PDF" of sheet 1 of window 1
click menu item "Save as PDF…" of menu 1 of menu button "PDF" of sheet 1 of window 1 -- Save as PDF...
tell application "Finder"
set filesavepath to "/Users/Ariel/Google Drive/To print"
end tell
end tell
说完
AppleScript 的最后部分,来自“告诉应用程序查找器”,实际上并没有使页面保存在我想要的位置。请你帮我解决这个问题。感谢您的帮助。
爱丽儿
【问题讨论】:
标签: safari applescript savefiledialog reader