I have an AppleScript to open move a Safari webpage into Reader view and then to Save As a PDF.
I would like it to Save As the PDF with default filename, but always in the same specific location. I'm not sure how to do this.
Currently the AppleScript runs as:
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
The final bits of the AppleScript, from 'tell application finder' do not actually make the Page save in my desired location. Please could you help me to this. Thank you for any help.