Skip to content

Instantly share code, notes, and snippets.

@parezcoydigo
Created February 7, 2014 22:51
Show Gist options
  • Save parezcoydigo/8873640 to your computer and use it in GitHub Desktop.
Save parezcoydigo/8873640 to your computer and use it in GitHub Desktop.
Applescript to add email to todo.sh from Mail.app. If you use the `nav` plugin, you can open the email in Mail.app with `todo.sh nav ITEM#` from the cli.
tell application "Mail"
set theSelection to selection
set theMessage to first item of theSelection
set theURL to "message://%3C" & message id of theMessage & "%3E"
set theTitle to subject of theMessage
end tell
set theTitle to do shell script "echo " & quoted form of theTitle & " | sed 's/'\\''//g'"
do shell script "/usr/local/bin/todo.sh a follow up on " & theTitle & ": " & theURL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment