I don’t like to repeat myself to stay productive. That’s part of the reason why I’m constantly looking to optimize my productivity workflows. Using tools like OmniFocus and Workflow from DeskConnect, Inc., help me meet those needs. Since I switched to OmniFocus earlier this year, I haven’t looked back—I’m even looking forward to a bright future!

What is Automation?

As a former software architect, I used to apply an awful lot of principles, best practices, and design patterns to the systems I had to build. One of them is the DRY principle: Don’t Repeat Yourself. It’s aimed at reducing repetition in information of all kinds.

In the productivity world—and with today’s abundance of technology and apps—the DRY principle can be applied by using scripts that allow you to automate things you would normally do by hand. These scripts run on your devices using scriptable apps. When you don’t automate—at best—you: copy, paste, modify, and repeat this process every time you need it. These individual steps are unbearable to me.

Automation is all about having a dynamic system that allows you to save time and energy. For me, it’s even fun. It’s meant for the repetitive tasks that slow you down or provide enough friction that postpone or cause you to neglect actions. The less friction, the better.

Capture and clarify for GTD lovers

There’s even beneficial side effects from automation.

If, like me, you use the GTD methodology to get on top of your life, the two unavoidable steps are:

1. capturing
2. clarifying

Templating in particular, along with automation in general, can help you do both in one step! Indeed, the actions you create by automation will be captured, and even partially processed, automatically. Processing clarifies the outcome of your action and allows immediate understanding of what you’re about to do. Automation can help by guiding the input process using a simple question/response principle.

But enough with the concepts. Let’s get our hands dirty.

The Template Workflow

When Ken Case announced the availability of OmniFocus 2.14, I immediately booked a slot in the testing program. Later, he published an example script using Editorial to create an OmniFocus project from a TaskPaper template.  Screenshot showing an OmniFocus workflow created from a TaskPaper template

I couldn’t dig into the script as I didn’t have the Editorial app, but I did have Workflow.

Let’s have a look at a very simple and fictional example project we would like to transform to a template:  OmniFocus screenshot showing a simple project with five items

Mmm..There are some notes which you can’t see because it’s not possible to show the outline of the project and all notes at the same time. Let’s try to represent this project using a pure text format:

Now we have the whole picture, and it’s pretty readable. And guess what? You just learned how to create an OmniFocus project in the TaskPaper format! You’re not a TaskPaper pro quite yet, but you get the point. If you want to learn more, use this reference file. Ken Case put together a great summary of the format in the TaskPaper format section in this thread.

My template requirements

You may have noticed that I put certain words in italic. That’s because I’d like to replace these words depending of the context. The project’s technical lead can vary from project to project. So I need to replace that portion of the action title by a meaningful name, for example the name of the real person. This is where placeholders come into play. In your template, you just need to replace the words that will vary by the placeholder. Let’s use the following convention: placeholders will be put between « and ».

I know that I have meetings on every Wednesday morning at 10 am, but sometimes the meeting is moved to another day. I’ll have to take that into consideration, too.

This is a sequential project, i.e. each action has to be completed in order, from top to bottom. The project has to be completed on the meeting’s day, or earlier, and let’s say I would like to complete an action each day prior to the meeting date.

We can now modify the template to take our requirements into account :  Screenshot showing OmniFocus project with placeholder text

… and in TaskPaper format, so you can see it all:

So what do @due and @parallel represent? They’re TaskPaper tags. There are currently 11 tags you can use in OmniFocus 2.15. Go to this page at the end of the TaskPaper Format section to read the full list (the eleventh tag is @autosave which has been added in the 2.15 release and is not listed there yet). These tags map to an OmniFocus action’s attributes like the time estimate, the due date, the context … you name it.

On to the workflow

To use the workflow I’m about to present to you, you’ll need to open the template project and use the share extension. Like so:
Animated screenshot demonstrating how to to use the share button to run a Workflow script

After a few taps the workflow begins. Just fill in a few prompts:
Animated screenshot demonstrating filling in prompts in Workflow

I won’t go too much into the ins-and-outs of writing scripts in Workflow, but I will give you an overview of the logic behind it and how it fits in to the OmniFocus URL scheme. Before that, a quick bit about URL schemes.

URL schemes are a way to jumpstart apps’ functionalities from other apps without having to manually launch them first. Let’s try this: open Safari on your iOS device and type (or click the link) in the URL bar: OmniFocus:///. This will simply launch our beloved app!

If you want to go further, try adding a few parameters that are built-in to OmniFocus, like so: OmniFocus:///add?name=An%20Action&note=A%20note&flag=true. We’ve just created a flagged action in OmniFocus, from Safari, with a name and a note (because this is a URL, spaces must be encoded with %20). Pretty useful!

The last piece, which is essential if you want apps to communicate with each other in both ways, is the support for x-callback-url. This is a mechanism that allows apps to be called and chained together, essentially a back and forth between the two (or more!). URL schemes and x-callback-url are at the heart of automation on iOS.

This particular workflow makes use of the x-callback-url for the /parse-date URL action and the /paste URL action.  Screenshot showing a workflow with matches, repeats, and if conditions

In the first part of the workflow, I search for all the placeholders which I need to curate so that you’ll be prompted only once to replace a placeholder that would appear multiple times in your template.

Screenshot showing a workflow with an x-callback-url that goes to OmniFocus

This excerpt shows you how to use the x-callback call so that you can rely on OmniFocus to parse a date and get the result back in Workflow. The URL used is:

OmniFocus://x-callback-url/parse-date?input=Input. Input is a Workflow variable containing the date to be parsed.

Screenshot showing a workflow that replaces text

This is the heart of the Workflow: all placeholders are replaced by the values you just entered. Pretty simple, yet very powerful.  Screenshot showing a workflow that pastes text in OmniFocus

Now the resulting TaskPaper formatted actions are sent to OmniFocus by using the /paste url action. I personally like to use the Inbox so that I can review the result and process appropriately. But you can change the target to projects if you prefer to. Starting with version 2.16, you have even more control when it comes to choosing the target, be it a folder, a project, or even an existing action. See here for more details.

My Workflow should work for any template — as long as you use the convention of putting your placeholders between « and » and use the keyword date in a placeholder to have the input parsed by OmniFocus. Of course, you can modify it to your needs and make it even more powerful. You can download it here.

Wrap up

I hope this was a useful look at what automation can bring to your own productivity—especially in combination with OmniFocus. In this article, I’ve talked about using the Workflow app to power my templating…but it’s not limited to just that. You could manage your templates (written in TaskPaper format) in different apps, like Editorial or Drafts. My approach to store templates in OmniFocus has pros and cons, but I find it practical to be able to review my templates within OmniFocus’ review perspective. It’s also more convenient to create and edit templates using OmniFocus’ own interface.

We only scratched the surface by focusing on templating; OmniFocus’ automation features can also be used in many other ways.

I also use Workflow to:


❮ More Workflows