Created
October 1, 2014 01:21
-
-
Save jrarseneau/e0abe8edfaff9965305c to your computer and use it in GitHub Desktop.
Mail to OmniFocus for OS X Yosemite
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Mail to OmniFocus by J.R. Arseneau | |
-- http://theinterstitial.net/ | |
-- | |
-- Small AppleScript that works in Yosemite to mimick | |
-- the Clip-o-Tron from The Omni Group. | |
-- | |
-- v1.0 - 30 September 2014 | |
-- | |
-- Known Issues: | |
-- | |
-- - Will only do 1 message at a time (no multi-select or threads) | |
-- | |
tell application "Mail" | |
set theSelectedMessages to selection | |
set the theMessage to item 1 ¬ | |
of the theSelectedMessages | |
set theMessageID to the message id of the theMessage | |
set theMessageSubject to the subject of the theMessage | |
set theMessageBody to the content of the theMessage | |
set theMessageSender to the sender of the theMessage | |
set theMessageRecipient to address of first recipient of the theMessage | |
set theMessageDate to the date sent of the theMessage | |
set theMessageURL to "message://%3c" & theMessageID & "%3e" & "\n\n" & "From: " & theMessageSender & "\n" & "Subject: " & theMessageSubject & "\n" & "Date: " & theMessageDate & "\n" & "To: " & theMessageRecipient & "\n\n" & theMessageBody | |
tell application "OmniFocus" | |
tell quick entry | |
make new inbox task with properties {name:theMessageSubject, note:theMessageURL} | |
open | |
end tell | |
-- Make sure task name is selected for easy editing | |
tell application "System Events" | |
keystroke tab | |
end tell | |
end tell | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment