OmniFocus date manipulation with AppleScript

The extensibility of OmniFocus is nearly unlimited and AppleScript is the way of leveraging it. Ryan Davis posted a nice overview of AppleScripts that help him manipulating task dates.

  • Defer takes the selected tasks and shifts their start and due dates by a user defined number.
  • Skip filters on the selected repeating tasks, marks them as done, and then deletes them.
  • Stagger Dates takes the selected tasks and redistributes them one weekday at a time
  • Stagger Times does the same thing as Stagger Dates, but for a single day
  • Followup takes the currently selected task, duplicates it, prefixes with “Followup: “, and then schedules it for a week out
  • Fix Start Dates takes the selected tasks and makes sure that the Start Date is filled in to the same day as the Due Date, if any.

Ryan provides some examples of how he uses these scripts and a very simple AppleScript code example that let’s you build your own task focussed scripts.

Clipping from nvALT into OmniFocus

I have started to use nvALT again to take my notes during meetings and calls. Yesterday was a rather epic call day with 8 out of the 10 hours I worked spent on the phone. Consequently many notes were taken and lots of actions had to be clipped from nvALT to OmniFocus for processing and tracking.

When I finished hitting my OmniFocus clipping hotkey (⌘⌥^-C) about twenty times, I was shocked looking at my OmniFocus inbox with each clipped actions looking like this:

Result of a line clipped from nvALT into OmniFocus

The actions I wanted to be captured ended up in the note field and the task itself just reference nvALT. Now this is not a hugh problem if you have just one or two things clipped, but it is if you have twenty or more.

Reaching out to my fellow tweeps for an script-based solution brought Ben Waldie, AppleScript guru by profession, to rescue me.

His neat little script does nothing else than swapping task title and note around for all tasks currently selected.

tell application "OmniFocus"
    tell content of front window
        set theTasks to value of every selected tree
        repeat with aTask in theTasks
            tell aTask
                set theName to name
                set theNote to note
                set name to theNote
                set note to theName
            end tell
        end repeat
    end tell
end tell

Be aware that the script is rather minimal in nature and has no error handling. Make sure you use it with tasks selected that do feature a title and a note.

OmniFocus and Basecamp

Amongst all online collaboration solutions Basecamp is the best one I ever came across. 37signals is putting a lot of thoughts and efforts into the platform to keep it simple, purpose driven and extremely user-friendly. Unfortunately I am required to use a different platform at work which has yet to adapt the design principles of Basecamp.

Those that manage their personal tasks in OmniFocus and leverage Basecamp for collaboration are always looking to integrate the two. At least to a certain extent.

Ryan Irelan has updated and reposted his AppleScript based solution that uses Mail.app rules to accomplish this. Check out his original description for instructions and more details.

The beauty of Ryan’s approach lies in its simplicity and the fact that you can use it with tools you have out of the box and consequently free of charge.

For a more professional grade integration between Basecamp and OmniFocus you should give Spootnik a go. It uses the WebDAV sync capabilities of OmniFocus not only to keep your data the same across your devices, but also between Basecamp and OmniFocus.

Spootnik also fulfils two very popular feature requests for OmniFocus by providing an web interface to your data and allowing you to email actions directly to your inbox.

While you can test drive it for 30 days, the subscription model starts at 3$ per month. 

OmniFocus Mail.app rule with attachments

Bryan Kyle had an itch and scratched it.

One things that has always bothered me about it is that it doesn’t do anything with attachments. If you create one of these specially formatted messages and attach a file, you would expect that the attachment would be added to the newly minted action.

With his modified AppleScript Mail.app will now honour the attachments in any email being processed by the magic OmniFocus mail rule. Good luck with all these images people still have in their corporate signatures.

Chrome URL to OmniFocus task

Nice little hack from Aaron Hockley

Next time you’re on a web page in Chrome and want to create a related OmniFocus task, just invoke the OmniURL item from Alfred (you could also set a hotkey). A new item will be created in your OmniFocus inbox with the page’s title as the item text and the URL in the notes field.

While leveraging Alfred, the solution is based on this AppleScript hosted on github and should also work with other launchers.

Using Automator with Ben Waldie - MacPowerUsers
[Flash 9 is required to listen to audio.]

Using Automator with Ben Waldie

  • MacPowerUsers
  • Episode 70

Download 42 plays

The forgotten tool: OS X Automator in MacPowerUsers podcast

I need to admit I haven’t looked at the little robot in my Utilities folder for a very long time. Yet you can still do a truck load of useful things with it. In particular if you aren’t willing to learn AppleScript or even more nerdier things.

Katie Floyd and David Sparks are joined by Automator expert Ben Waldie who has many tips and tricks for you. You should check his website on Mac automation as well.

Automator is definitely something I will go back to and leverage more after listing to this episode of Mac Power Users. Unfortunately OmniFocus does not (yet) expose any Automator functions, but OmniOutliner as an example does.

And yes, I know this was already three episode ago, but I am as behind on things as you are.

Adding actions to OmniFocus from Terminal

A while ago the great Brett Terpstra, well known for his Markdown tools, has released a Command Line Interface (CLI) tool for adding tasks to OmniFocus. It’s not straight forward to setup as you need to install a few Ruby gems first. If the last sentence sounds like from a different planet, this tool isn’t exactly for you. If you know Ruby, gems and Scripting Bridges, you may actually also have a use case for CLI tool that adds you stuff to OmniFocus.

Export a list of active OmniFocus projects to a text file

Not really sure why I didn’t post about it here, but Justin Lancy of Veritrope scripting fame has picked up on a tweet of mine asking for help exporting a list of all active projects in OmniFocus. His script takes it as far as an alphabetically sorted text file you can save to any location you chose. While I originally wanted an export to OmniOutliner, I believe this solution is more universal and I can find my own way from here.

My use case for this list is my Weekly Review. I like having a simple overview of all my current commitments to see if I am focussing in the right direction. Getting a similar one page overview in OmniFocus is difficult and highly depends on the theme you are using.

Update: Chris Brogan with help from OmniFocus scripting legend Rob Trew extended the script to generate a weekly report. It groups projects by folders and sub-folders, skips single action lists and also shows all items completed in the last 7 days. Chris actually uses it to send a report to his boss. If you need more sophistication then this script is for you.

OmniFocus Statistics for the productivity geek

Robin Francis Trew, aka RobTrew well known AppleScript guru in the OmniFocus forum, has released this little application that provides you with detail statistics about what lives in your OmniFocus database. It won’t help you the get any work done or make the world a better place, but if you ever wondered how many projects you have it’ll tell you the naked truth. High-res

OmniFocus Statistics for the productivity geek

Robin Francis Trew, aka RobTrew well known AppleScript guru in the OmniFocus forum, has released this little application that provides you with detail statistics about what lives in your OmniFocus database. It won’t help you the get any work done or make the world a better place, but if you ever wondered how many projects you have it’ll tell you the naked truth.

Simple Sync of Omnifocus to iCal events

This handy script by Yilei Yang and Mike Erickson allows you to “export” your actions from Omnifocus that have either start or due dates to iCal as events.

While Omnifocus allows you to sync your actions as ToDos to iCal, this script adds them as events to a pre-defined calendar which may come in useful when sorting your day by looking at the hard landscape.

Yilei’s version simply adds them to a pre-defined calendar while Mike’s version also adds alarms.

Note that this no full “sync”, but more of an export: Every time you invoke the script the calendar gets wiped and populated with a fresh export.