Skip to content

Instantly share code, notes, and snippets.

@hfossli
Created February 8, 2021 11:57
Show Gist options
  • Select an option

  • Save hfossli/5648efbe554d6e58a65d4ba5477a8779 to your computer and use it in GitHub Desktop.

Select an option

Save hfossli/5648efbe554d6e58a65d4ba5477a8779 to your computer and use it in GitHub Desktop.

Revisions

  1. hfossli created this gist Feb 8, 2021.
    28 changes: 28 additions & 0 deletions script
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    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