In keeping with GTD principles, every time a task comes to mind, I have to get it into OmniFocus right away. The longer it stays in my brain, the more likely I am to forget it.
OmniFocus has a quick entry mechanism that allows me to type
^ + Space and enter tasks at lightening speed. There’s one catch, however: OmniFocus has to be open for it to work. Believe it or not, I don’t always have OmniFocus open. Opening it, then entering my tasks introduces a slightly irksome level of friction, and that isn’t acceptable.
I realized that this was true of OmniFocus’ AppleScript methods, as well: OmniFocus needs to be open in order for them to work. Given that I have some workflows that make use of these methods, this, too, introduced friction.
With a smart Applescript, it’s possible to add tasks to OmniFocus regardless of whether it’s open.
I brainstormed a bit and came up with a flow to remove the friction and be more robust overall:
- If OmniFocus is open, use its AppleScript methods to add tasks.
- If OmniFocus isn’t open, use Mail Drop.
Fortunately, with a little wizardry, this can be accomplished in a variety of workflows. Here’s how to do it.
In order to do #2 above, it is necessary to install and configure a mail server on OS X. Postfix is a great option and, once installed, allows you to easily send email via the command line.
/usr has a guide on installing Postfix on OS X. Use it to set up Postfix on your own machine.
The Generic AppleScript
Although my various OmniFocus workflows include other applications and scripts, the same base AppleScript is used across each:
There is a decent amount happening here, but it’s not difficult to understand. The basic flow goes like this:
- Query OS X and see how many instances of the “OmniFocus” process exist.
- If more than one instance is running, use OmniFocus’ AppleScript methods to create a task.
- Otherwise, use the
With this flow in place, all sorts of new workflows become possible.
Alfred 2 Workflow
This Alfred 2 workflow gives me a quick entry mechanism comparable to OmniFocus’ own method, but which makes use of my base AppleScript:
With this, Alfred can give me the quick entry experience that I want – I simply use the
…and the task is added to OmniFocus, regardless of whether it’s open or not:
Apple Mail Service
This Automator service works on any selected messages in Mail:
- Sends the email to OmniFocus as a task.
- Attaches the
@FollowUpflag (a byproduct of the excellent MailTags) to the email.
The power lies in the AppleScript that comes along with the service:
Thus, I can select a group of messages…
…and run the service, which nicely tags the messages for follow up…
…and sends them to OmniFocus as tasks:
Another nice feature: the task’s note includes a URL back to the original email:
nvALT Checkboxes via Hazel
I mentioned this workflow in my posts on OmniFocus and nvALT – its purpose is to take “checkboxes” in nvALT (which I label as
[ x ]) and convert them into OmniFocus tasks. As with the other workflows, it allows me to file tasks into OmniFocus whether it is open.
The companion AppleScript used by the Hazel rule looks like this:
(Notice the ridiculous number of accompanying methods used to create a link back to the nvALT note; I wish I knew a better way.)
Entering some tasks into nvALT:
[ x ] Task #2
…causes Hazel to parse them into OmniFocus tasks:
Once again, these tasks’ notes contain links back to the original nvALT notes:
Some might look at this and think it’s a tad overkill. Why not just keep OmniFocus open? you might say. It’s a valid point, but in my own workflows, I’ve simply noticed that it doesn’t always happen. That’s usually enough of an impetus to drive me to invent a solution like this.
The truth is, when OmniFocus is open, its AppleScript methods are quicker (and it seems less elegant to email tasks when there are quicker methods). When OmniFocus is closed, however, the email method removes the friction that I’ve grown to dislike. Having one automated method for both saves me time, and that’s what productivity is all about.