It’s been a nerdy weekend. Surprise.

I usually use TaskPaper when working on coding projects, and I have an array of tools for working with it from the command line. Every once in a while I do need to add a task to OmniFocus (where I keep my non-coding todo lists) too, though. I used to use my script “OTask” for that, but it’s been neglected since Mavericks came out and wasn’t working for me anymore.

I’ve updated the script to work with Ruby 2.0 (which comes with Mavericks), and made the intallation much easier by packaging it up as a gem. You can just run gem install otask in Terminal to get started (may require sudo gem install otask). It’s not super-polished, but I got it to a point where it was working smoothly for me and thought I’d share.

Note: If you use Xcode 5.1 and have trouble installing the gem, see this post for a fix.

The reason the headline says “for now” is that this script was based on appscript, which is a dead project and its days of working on OS X are numbered. Still, it’s working great right now on my Mavericks machine, so I’d say it’s got a little time left.

In a nutshell, OTask lets you add OmniFocus tasks directly from the command line, and optionally include project (#proj) and context (@cont) tags that will resolve to the closest matching project and context names. Add d(tomorrow 3pm) and a due date will be set. End the task with a space and an exclamation point to flag it (otask "finish your dinner d(5pm) !"). Anything in parenthesis besides a due date marker is considered to be a note and is added to the task’s note section.

The details of the tool and its syntax are on the OTask project page. It’s been tested with OmniFocus and OmniFocus 2, which you probably don’t have yet. It will work when we all get there, though. If you do have the beta of OmniFocus 2 installed, it will default to using that, I believe. It is for me, anyway.

There’s a Launchbar action in the project notes, and making one for Alfred would take 2 minutes. Both launchers already have OmniFocus scripts available, though, so I’m not spending much time on that.

If you’re an I-like-the-command-line-but-I-still-need-OmniFocus kind of person, check out OTask.