Colter has an excellent post which shows you how to create OmniFocus project templates with AppleScript—and this is a fabulous tool which is ideal for use at your Mac. However, if you’re on the go a lot and don’t carry a Mac with you, then you can’t use AppleScript—but on iOS, you have an excellent, free, tool at your disposal, Workflow.
I’m going to use the same examples Colter used, and re-create them in Workflow to give you some examples of how to manipulate it.
The purpose of this project is to create a simple project with two tasks, the project should be called Pay month name rent, and be sequential. It would have two tasks—to write the check and drop it off.
We want the project name to contain the name of the month (to make it easy to identify), and for the project to be due on the last working day of the month, and to start a week before then.
Our first step is to calculate the last working day of the month, we start by getting the last day of the current month (Workflow doesn’t have a simple way to do this, so we get the 1st of the current month, add a month, and subtract a day). If this day is a Saturday or Sunday we calculate back to the previous Friday. Now we have the date we can get the week before it as our defer date.
The final steps here are the get the current month name, to construct the TaskPaper, and then to send that to OmniFocus. The TaskPaper is as follows:
Pay «Month» Rent @defer(«Defer Date») @due(«Due Date») @parallel(false) @context(Home): - Write out rent check - Drop off rent check
The items surrounded with French quotation marks («») are the Workflow variables which are replaced with the dates we have calculated. This is added as a top-level project. If you wish to create this project inside a folder then you need to modify the final action, to
Add to Folder (instead of
Add to Projects), and to type in the folder name.
You can get the Workflow here: Pay Rent OmniFocus Project.
Sending Birthday Cards
This Workflow has an enhancement over the original script, it allows you to choose from events on the default iOS birthday calendars which take place within the next two months, you can, of course, change the calendar and the time period it searches through. After you have chosen one or several events to create these projects for, the Workflow starts calculating the dates for the tasks.
First of all, we calculate two weeks before the event happens, and then get the Saturday before that. This gives us the dates when we should buy the card, and sign the card. Then we calculate 10 days before (for mailing the card), and 11 days before (for preparing the card for mailing).
The final steps are the same as the above Workflow, to create the TaskPaper and add it to OmniFocus, here we are actually creating action groups inside of a “Family” project—you may wish to change this to match your project structure.
You can get the Workflow here: Birthday Card OmniFocus Project.
Creating Your Own Workflows
Like the AppleScript post, this one is not intended to be a guide to creating Workflows. However, you can take them apart and adjust them to meet your needs.
A few tips:
- Don’t be scared to break them. You can drag and drop the action blocks in Workflow around to suit your needs—and if it doesn’t work there’s an undo button in the top left. If you completely break things you can download the workflows again from the links in this post at any time.
- Make something that works for you. Automation is very worthwhile, but only if it needs your needs.
There are several OmniFocus actions in Workflow, and these work with both OmniFocus 2 and OmniFocus 3 for iOS. The TaskPaper in these uses
@context as this is compatible with OmniFocus 2 and OmniFocus 3, you can safely change it to
@tags if you have OmniFocus 3.