Skip to content

Instantly share code, notes, and snippets.

@oreoshake
Last active March 30, 2019 20:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oreoshake/7c861223547ca6fee2aa56a7e78d1a1f to your computer and use it in GitHub Desktop.
Save oreoshake/7c861223547ca6fee2aa56a7e78d1a1f to your computer and use it in GitHub Desktop.
script to generate my daily calendar and send the file to my reMarkable table
# This script assumes you have set up a "Print to ReMarkable" automator print plugin script
# Follow https://github.com/juruen/rmapi/blob/master/docs/tutorial-print-macosx.md
# crontab -e and add:
# */15 * * * * osascript /path to your script.scpt >> some log file
# «class menI» Print to ReMarkable of «class menE» PDF of «class menB» PDF of window Print of «class pcap» Calendar
# You will probably run into permission errors when editing the crontab and when the job actually runs
tell application "Calendar"
activate
end tell
tell application "System Events"
keystroke "esc"
keystroke "t" using command down -- hotkey to go to today
end tell
tell application "System Events"
tell process "Calendar"
tell menu bar 1 -- Ick
tell menu bar item "File"
tell menu "File"
click menu item "Print…"
end tell
end tell
end tell
repeat until exists window "Print"
end repeat
tell window "Print"
click pop up button 2 -- how can I better reference this drop down???
click menu item "Day" of menu 1 of pop up button 2
click pop up button 4 -- same
click menu item "Today" of menu 1 of pop up button 4
click button "Continue"
click menu button "PDF" -- why does this step take forever???
click menu item "Print to ReMarkable" of menu 1 of menu button "PDF"
end tell
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment