Advertisement

AppleScripting OmniFocus: send due tasks to iTunes

AppleScripting OmniFocus  Send Due Tasks to iTunes

OmniFocus is a great tool for keeping us organized. But, let's face it. We're busy people. That's why we need a task management app in the first place. How can you take your productivity to the next level? How about having your daily OmniFocus tasks read to you as you drive to work? With a little help from AppleScript and Automator you can make that happen. Here's how...

Setup

In order to run this script and workflow, you'll need to make sure you have an OmniFocus perspective named Due, and that it's set up to display any tasks that are considered Due Soon. This is a default perspective, so you probably already have it. You can adjust what's considered Due Soon in the Data section of OmniFocus' Preferences window, under Dates & Times.

Building the Workflow

Note: If you get stuck or have trouble following along, you can download the complete AppleScript and Automator workflow here.

1. Launch Automator and create a new iCal Alarm workflow.

AppleScripting OmniFocus  Send Due Tasks to iTunes

Creating an iCal Alarm workflow in Automator

2. Find and add the Run AppleScript action to the workflow, and enter the following AppleScript into the action's script area.

When run, this script opens OmniFocus, displays the Due perspective, retrieves a list of tasks, and generates an audio file on the Desktop.

AppleScripting OmniFocus  Send Due Tasks to iTunes

The Run AppleScript action handles the OmniFocus work

3. Add the Import Audio Files action to the workflow, and set it to Delete source files after encoding.

AppleScripting OmniFocus  Send Due Tasks to iTunes

This action imports the audio file and cleans up afterward

4. Insert the Add Songs to Playlist action. Set it to add to a New playlist named OmniFocus.

AppleScripting OmniFocus  Send Due Tasks to iTunes

This action adds the imported audio file to the OmniFocus playlist. It only creates it if it doesn't already exist.

5. Save the workflow as OmniFocus > Send Due Tasks to iTunes. When you do this, iCal opens and a new event is added to an Automator calendar, which is created if it doesn't already exist. The event is configured with an Open File alarm set to run the workflow.

AppleScripting OmniFocus  Send Due Tasks to iTunes

Saving the workflow puts it in the proper location and automatically creates an iCal event

6. Set the workflow to run each day at the desired time.

AppleScripting OmniFocus  Send Due Tasks to iTunes

You can set the workflow to run anytime you want

Once configured, the workflow should run as scheduled. When it does, it should retrieve list of your OmniFocus due tasks, convert them to audio, and import them into an OmniFocus playlist.

AppleScripting OmniFocus  Send Due Tasks to iTunes

Example Due tasks in OmniFocus

AppleScripting OmniFocus  Send Due Tasks to iTunes

The imported audio task list can be added to your iPhone for on-the-go access