Skip to content

Instantly share code, notes, and snippets.

@dannysmith
Created February 4, 2016 01:21
Show Gist options
  • Select an option

  • Save dannysmith/e9356d991fd74c36acb8 to your computer and use it in GitHub Desktop.

Select an option

Save dannysmith/e9356d991fd74c36acb8 to your computer and use it in GitHub Desktop.
-- See here: http://www.macstories.net/tutorials/send-selected-mail-message-to-evernote-with-source-url/
-- Slightly modified version of Efficient Computing's AppleScript: http://efficientcomputing.commons.gc.cuny.edu/2012/03/17/copy-email-message-in-mail-app-to-evernote-applescript/
tell application "Mail"
--get selected messages
set theSelection to selection
set theMessage to item 1 of theSelection
set evernoteEmail to "[email protected]"
set theMessageURL to "message://%3c" & theMessage's message id & "%3e"
set the clipboard to (theMessageURL)
--set theMessageLink to "<a href='" & theMessageURL & "'>Original Message Link</a>"
--set theMessageDate to the date received of theMessage
--set theMessageSender to sender of theMessage
--set theMessageContent to content of theMessage
--set theMessageSubject to the subject of the theMessage
set theRedirectedEmail to redirect theMessage with opening window
tell theRedirectedEmail
make new to recipient at beginning of to recipients with properties {address:evernoteEmail}
end tell
keystroke "O"
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment