A couple of days ago, I posted an article detailing how to use Keyboard Maestro to create todos in OmniFocus 2 that are linked to original messages in Mail.app. Security-conscious Ben Brooks thought the idea was neat, but couldn’t give it a try, as it relies on the use of the OmniSync Server.
That got me thinking, and I came up with a simpler way to achieve the same thing—directly, without having to generate and send messages to the OmniSync Server Mail Drop.Here’s the idea:
- Assign [control][space] to the Keyboard Maestro macro. This is the keystroke I normally would have assigned to OmniFocus’s Quick Entry feature.
- Assign some other keystroke to OmniFocus’s Quick Entry feature.
And here’s how the Keyboard Maestro macro works:
- Check if we’re in the Mail.app application. If not, invoke the OmniFocus Quick Entry trigger keystroke.
- If we are in Mail, then get the URL of the selected message.
- Invoke the OmniFocus Quick Entry trigger keystroke, paste the message URL into the Note field, and return cursor focus to the title field.
This works great! Here’s what that macro looks like:
And repeated from the previous post, here’s the AppleScript that gets the selected message URL:
tell application "Mail"
set _sel to get selection
set _links to {}
repeat with _msg in _sel
set _messageURL to "message://%3c" & _msg's message id & "%3e"
set end of _links to _messageURL
end repeat
set AppleScript's text item delimiters to return
set the clipboard to (_links as string)
end tell
Enjoy!
Thanks for this – very helpful.
I wanted more in the OmniFocus item note, so inserted two more actions after the “Type the ⌘V Keystroke”.
(1) To set the clipboard to text with the mail subject, from, and contents
(2) To do another Type the ⌘V Keystroke to paste it into the note.
The screen capture below shows what I inserted.
I’m pretty sure you’ve just re-created the Clip-o-tron 3000 that’s been around for quite a while, no?
Here’s a standalone installer they created for v2.
http://support.omnigroup.com/omnifocus-clip-o-tron
Thanks for that, too. I wasn’t aware that they had made a new one for v2. This is no mentioned in the OmniFocus v2 help.
Thanks for that, Kennon. With my current script, I suppose I wouldn’t need the “Clip-o-tron 3000”. (Off topic: Jeez—who came up with that name?)
Yea, you shouldn’t need it with what you’ve created.
The one nicety to your script is that you only have one command to trigger whether you’re in Mail, or somewhere else on the system. That distinction was lost during my initial read.
:thumbsup:
Any way to customize this for a Postbox > OmniFocus workflow??