OmniFocusCLI: Natural Language Tasks from Alfred

Today I am introducing OmniFocusCLI. A very advanced shell script I have designed to take natural language input from Alfred and hand-craft it in to a perfectly formed OmniFocus task. This was an ambitious project and for those who know me, know how proud I am of the results. This is by no means a polished, flawless release… but if you are not at least a little embarrassed by your v1.0 then you probably waited to long, right? There are still features I plan to integrate in time, but for now, it’s a great release and I am excited to share.

So how does one install OmniFocusCLI?

Start by downloading the latest version of OmniFocusCLI from this link to its GitHub Repo: OmniFocusCLI

Inside this zip folder is the OmniFocusCLI.sh script. Extract it to a location of your choice.

Create a new Terminal / Shell shortcut in Alfred.

Mine looks like this:

Title: Add Task to OmniFocus

Description:

Keyword: task

Command: /Users/USERNAME/LOCATION_OF_SCRIPT/OmnifocusCLI.sh {query}

Do not check the boxes for Quotes or Spaces

Click save.

On the main Terminal / Shell Shortcuts screen, check the box for Silent but leave the box for Action blank.

At this point, you should be able to test your OmniFocusCLI script from Alfred and it should work.

If it doesn’t, it is probably because the script does not have permissions to execute on your computer.

To fix this, simple fire up the Terminal. Browse to the location of your script and execute:

chmod +x OmniFocusCLI.sh

The next time you try to add a task, it should work fine!

Now keep in mind because this is just a shell script, you are not limited to using it with Alfred. You can run it from the terminal, you can create tasks while SSH’d in to your Mac, you can even call it from a Hazel rule. How often have you used Hazel to manage your files and could have utilized a rule that creates an OmniFocus task based on the file that Hazel is working with. Well now you can, and I use it all the time.

 

How does one use OmniFocusCLI?

 

First off, this even works if OmniFocus is closed, unlike the Quick Entry window. It also goes straight to the inbox! I know my post on using the custom URI for creating tasks just opened the quick entry window which was nonsensical. Never the less, I am going to get responses about how great the Quick Entry is, and trust me, I agree. For a lot of reasons the quick entry is irreplaceable, but I feel there is a real benefit from quick, natural language task creation from a launchbar. It’s something I’ve wanted for a long time, so I decided to write it for myself.
Inputs that OmniFocusCLI will understand:

  • Simply use it with plain task names. i.e. Water the grass
  • It knows days of the week. i.e. Monday, Tuesday…
  • You can abbreviate those days as well. i.e. Mon, Tues, Wed…
  • It knows months and abbreviated months as well. i.e. January, Jan, February, Feb…
  • It knows times am/pm right down to the minute! i.e. 1pm, 12:45pm, 2am…
  • It also reads contexts from OmniFocus. i.e. Home, Errands…
  • It supports natural language like “Call Joe Blow” (for Phone context) and “Do something at home” (for Home context)
  • It can handle dates in the slash format (month/day). i.e. 8/20 for August 20th
  • But you can also just type August 20th because it can read that too.
  • It also knows natural words like Today and Tomorrow! i.e. Buy bread tomorrow
  • Too lazy to type out tomorrow? try tom… i.e. Buy bread tom
  • I supports a simple number of days, weeks, and months. i.e. Pickup wife 2d or Buy new TV 6w
  • You can even combine them! i.e. Fix broken computer friday 1pm @Work

*More coming soon!

I really felt I had to be this granular because OmniFocus users are use to that type of entry when working with dates inside of the program. Even more features are already in development for the next release (i.e. Notes maybe?), but feel free to make suggestions!

Normally at this point I would show the source code for the script but OmniFocusCLI weighs in at just over 550 lines of code, so instead of making you guys scroll for days to read it, I decided to make a screencast just demonstrating some basics on how to use it! Now enough of my rambling… Check out the screencast below to see this beast in action! (Because this screencast has so many dates, its important to know that it was recorded on 5/18/2011)

 

OmniFocusCLI Screencast from Don Southard on Vimeo.

 

Please send any bugs or feature requests to Support Email

  • http://ken.net Ken Snyder

    Ok please ignore me. I never solved WHY my previous problems were happening but then I realised that Don has done several updates on GitHub since I originally downloaded including the fully packaged version which is a complete breeze to install.

    Happy days. Sorry for my random sputterings.

  • http://twitter.com/pastorhudson Ron Hudson

    What would be really awesome is if this was ported as a plugin to the cydia tweak SearchCommands 
    https://github.com/theiostream/SearchCommands Haveing this on iphone/ipad in the spotlight field would be Amazing!

  • Behinder

    I installed it but it doesnt recognised your smart options like dates. context etc