Skip to content

Instantly share code, notes, and snippets.

@hfossli
Created February 8, 2021 11:57
Show Gist options
  • Save hfossli/5648efbe554d6e58a65d4ba5477a8779 to your computer and use it in GitHub Desktop.
Save hfossli/5648efbe554d6e58a65d4ba5477a8779 to your computer and use it in GitHub Desktop.
Automator script for opening mail application and printing the current open window
on run argv
tell application "Mail" to activate
tell application "System Events"
keystroke "p" using command down
delay 2
keystroke tab
keystroke tab
keystroke tab
keystroke tab
keystroke tab
keystroke tab
keystroke tab
keystroke tab
keystroke space
key code 125
key code 125
keystroke space
delay 2
keystroke "converted-email.pdf"
key code 36
end tell
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment