How to Automatically Flag Starting Tasks in OmniFocus

Bring Scheduled Tasks to Your Attention, Right on Time

by Colter Reed
2:07 read (647 words)
by Colter Reed
2:07 read (647 words)

OmniFocus lets you track a due date and a start date for each task or project. (In OmniFocus 2, start dates are being rechristened as deferred dates; the behavior is the same.)

Due dates should be used for just that—when the task must be completed, or there will be consequences. Start dates are when the task becomes available—before then, you can’t do anything about it.

I used a two-pages-per-day format when I had a paper planner. Each day had space for you to write the tasks for that day. During weekly planning, you put a task on Thursday, and the task would be waiting when Thursday came.

You can use start dates to schedule OmniFocus tasks for specific dates. With a little bit of scripting, you can have starting tasks automatically show up in the list of what you’re doing today.


Out of Sight Until You Need It

Scheduling tasks for specific days reduces the number of times you need to think about a task and reduces the chances that you’ll run out of time for it.

For example, my nephew’s birthday is July 28. I want to be sure to buy him a birthday card a week in advance so I have time to sign it and drop it in the mail. I don’t want to buy the card too early, so I don’t have to worry about losing it. I set the due date for July 21 and the start date for July 1.

Without the start date, I might not notice until late July that I need to buy him a card, and now there isn’t much time left. I now have a Buy Card task square in Quadrant 1. With the start date, the task comes on my radar earlier, on July 1, when I have more time to buy the card.

Before July 1, OmniFocus won’t show the task when you’re looking at Next and Available tasks. This reduces the clutter and helps you to focus on tasks you can do something about today.

Unfortunately, OmniFocus doesn’t do much to notify you when a task becomes available. The task will silently appear in your lists. With a little scripting, we can slip them effortlessly into your workflow.

Flagging Starting Tasks with a Script

The following script will flag any tasks whose start/deferred date is today. This causes the task to show up on your list of urgent and important tasks automatically.


on run
tell application "OmniFocus"
set todayDate to current date
set todayDate's hours to 0
set todayDate's minutes to 0
set todayDate's seconds to 0
set tomorrowDate to todayDate + 1 * days
tell default document
set todayTasks to (flattened tasks where (defer date ≥ todayDate and defer date < tomorrowDate))
repeat with t in todayTasks
set t's flagged to true
end repeat
end tell
end tell
end run

Download the script (or copy and paste into AppleScript Editor) and stick it wherever you store your user scripts. (I recommend ~/Library/Scripts).

You can run the script manually, but that’s one more thing to remember to do every day. Let’s do it automatically.

Automatically Flagging Starting Tasks

To automatically flag starting tasks, you can use a LaunchAgent to run OmniFocusDailyMaintenance.scpt every day at 6:00 am.


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>local.username.omnifocus-daily-maintenance</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/osascript</string>
<string>/Users/username/path/to/OmniFocusDailyMaintenance.scpt</string>
</array>
<key>StartCalendarInterval</key>
<array>
<dict>
<key>Hour</key>
<integer>06</integer>
<key>Minute</key>
<integer>00</integer>
</dict>
</array>
</dict>
</plist>

To install the LaunchAgent:
1. Download the plist (or copy and paste into your favorite text editor).
2. Change username (line 6) to your local user name.
3. Make sure the path to the script (line 10) is correct.
4. Move the plist into ~/Library/LaunchAgents.
5. Load the agent: launchctl load ~/Library/LaunchAgents/OmniFocusDailyMaintenance.plist (or just restart your computer).

You can also change the time the script runs. It should be early in the day, before you’re going to check OmniFocus for the first time. I have the iMac turn on at 6:00 am so it can start getting ready for the day.

If you use start/defer dates to schedule tasks and work from a list of urgent and important tasks (and you should), take a few minutes today to add this script to your setup. It’s a great way to tie the two workflows together and make them work even better.

Question: What’s your favorite way to automate OmniFocus? Share in the comments below! Share your thoughts in the comments, on Twitter, LinkedIn, or Facebook.