Skip to content

Instantly share code, notes, and snippets.

@bobbidigital
Created March 5, 2015 04:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save bobbidigital/51704e6ddda8a58c7a9c to your computer and use it in GitHub Desktop.
Save bobbidigital/51704e6ddda8a58c7a9c to your computer and use it in GitHub Desktop.
Convert email in Airmail2 to a task with the body of the message as a note.
tell application "Airmail 2"
set theMessage to selected message
tell theMessage
set theContent to htmlContent
set theSubject to subject
end tell
tell application "OmniFocus"
tell quick entry
set theRTFMessage to do shell script "echo " & quoted form of theContent & "|/usr/bin/textutil " & " -convert txt -stdin -stdout -format html"
make new inbox task with properties {name:theSubject, note:theRTFMessage}
set note expanded of every tree to true
open
end tell
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment