Better OmniFocus Task Entry


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.

TL;DR

With a smart Applescript, it’s possible to add tasks to OmniFocus regardless of whether it’s open.

The Beginning

I brainstormed a bit and came up with a flow to remove the friction and be more robust overall:

  1. If OmniFocus is open, use its AppleScript methods to add tasks.
  2. 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.

Postfix

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:

  1. Query OS X and see how many instances of the “OmniFocus” process exist.
  2. If more than one instance is running, use OmniFocus’ AppleScript methods to create a task.
  3. Otherwise, use the mail command (which, assuming you’ve followed the /usr guide above, uses Postfix) to mail the task to OmniFocus via Mail Drop.

With this flow in place, all sorts of new workflows become possible.

Alfred 2 Workflow

Download 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 of command:

OmniFocus+ for Alfred

…and the task is added to OmniFocus, regardless of whether it’s open or not:

Task From OminFocus+

Apple Mail Service

Download Service

This Automator service works on any selected messages in Mail:

  1. Sends the email to OmniFocus as a task.
  2. Attaches the @FollowUp flag (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…

Selected Messages in Mail

…and run the service, which nicely tags the messages for follow up…

Tagged Messages in Mail

…and sends them to OmniFocus as tasks:

Mail Tasks in OmniFocus

Another nice feature: the task’s note includes a URL back to the original email:

Message URL Note

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 #1
[ x ] Task #2

…causes Hazel to parse them into OmniFocus tasks:

OmniFocus Tasks via Hazel

Once again, these tasks’ notes contain links back to the original nvALT notes:

Link Back to nvALT

Closing Thoughts

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.

Enjoy!