Skip to content

Instantly share code, notes, and snippets.

@dalemanthei
Created January 1, 2015 19:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dalemanthei/0238fce1b1a17edd32c0 to your computer and use it in GitHub Desktop.
Save dalemanthei/0238fce1b1a17edd32c0 to your computer and use it in GitHub Desktop.
Mailplane 3 to OmniFocus clipping
-- From a combination of gists
-- Configured as a Keyboard Maestro macro in Mailplane 3 group bound to ⌘⌥^⇧C
tell application "Mailplane 3"
set theEmailUrl to currentURL
set theGmailUrl to my replace_chars(theEmailUrl, "mailplane://dale.manthei%40gmail.com/", "https://mail.google.com/mail/u/0/")
set theSubject to currentTitle
tell application "OmniFocus"
set theTask to theSubject
set theNote to theEmailUrl & "
" & theGmailUrl
tell quick entry
make new inbox task with properties {name:theTask, note:theNote}
open
end tell
tell application "System Events"
keystroke tab
end tell
end tell
end tell
on replace_chars(this_text, search_string, replacement_string)
set AppleScript's text item delimiters to the search_string
set the item_list to every text item of this_text
set AppleScript's text item delimiters to the replacement_string
set this_text to the item_list as string
set AppleScript's text item delimiters to ""
return this_text
end replace_chars
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment