Automation in OmniFocus 2.14 (released 2016-04-26)


#1

OmniFocus 2.14 is coming to TestFlight soon, and one of the things we’ve been working on is better support for automation.

To that end, the TestFlight builds now support callback URLs with name, note, parallel, flag, defer, due, project, and context parameters. Like so:

omnifocus://x-callback-url/add?name=some%20name&note=some%20note&parallel=true&flag=true&defer=8am&due=tomorrow%205pm&project=Important%20Project&context=Errands

The callback URL returns a link to the generated task, so the calling app can reference the task and open it later.

This is great for scripting OmniFocus with Workflow, but it’s not ideal for automatically creating large projects, since using this technique to create a project with 70 tasks ends up taking 70 round trips between OmniFocus and Workflow.

So we took this a step further, and added support for copying projects from OmniFocus as TaskPaper text and pasting them back into OmniFocus as TaskPaper text. And then another step further, creating an Editorial workflow. This Workflow accepts TaskPaper text with «placeholder» tokens and prompts for you to enter final values, then creates a project in OmniFocus 2.14 for iOS using those tokens.

For example, given this input:

- «project_name» @parallel(false) @due(«due»)
        - This task needs to be done at least 1 week before «project_name» is due @due(«due» -1w)
        - This task needs to be done at least 2 days before «project_name» is due @due(«due» -2d)

You’ll be prompted to enter values for «project_name» and «due». If you enter “Phonewave 1.2” and “next Thursday”, it will create a new “Phonewave 1.2” project in OmniFocus that is due next Thursday, and has two tasks already filled with due dates of this Thursday and next Tuesday.

With a single tap on this workflow, I get prompted to fill in my placeholders and end up looking at a new project in OmniFocus!

And you can too! Once you get your hands on OmniFocus 2.14, install this New OmniFocus Project workflow into Editorial and give it a try!


Routines/Daily Tasks
Template projects on IOS
Unhappy with mandatory taskpaper pasteboard format [Solved: no longer mandatory in 2.7]
How to handle small similar projects in OmniFocus
#2

Shouldn’t that be 2.14?


#3

Why, yes, it certainly should! Edited the post and title.


#4

Crazy stoked for that url scheme! That likely prevents the need for the autoparser I currently use.


#5

Your Editorial Link needs some doctoring - it should be editorial:// not http://editorial//… .

Just resigned for the testflight betas - looking forward to this so much.


#6

Thanks! Fixed.


#7

And the link to the Editorial workflow “New OmniFocus Project” doesn’t seem to be working either.


#8

This is a godsend. Thank you so much. Can’t wait for the version to go live.


#9

Oh, right, I forgot that our Discourse forums refuse to link to editorial URLs directly. Fixed.

Also, our TestFlight of OmniFocus 2.14 was just approved by Apple! If you haven’t already signed up, here’s our TestFlight signup page.


#10

Both the URL scheme and the taskpaper copy/paste have significant upside for those of us who are forced to work in windows but manage our tasks in omnifocus on IOS.

Well done OmniFocus Team!!!

– Stephen


#11

Ken, is it possible to create notes in the bulk mode via Editorial? I have a project I want to create in OmniFocus that has 365 tasks, one per day of the year, and I want to have custom notes for each that contain clickable URLs.

Thanks!


#12

Certainly! You can copy a project from OmniFocus and paste it into Editorial to see how to format it; for notes, you simple include indented text underneath the main item. For example, here’s a copy of the sample “Important Project” which has a task with a long note:

- Important Project @flagged

	- This action is part of a project with the special Flagged status. Tap it, then Note to learn more about prioritizing with flags.
		When an item is of special importance, giving it the Flagged status in the info pane of its editor is a great way to make it stand out. Flagged items are added to the Flagged perspective and styled in orange for greater visibility.
		
		Note that this particular action hasn’t been directly flagged — its status is inherited from the important project that it’s a part of. Flagged actions with inherited status are indicated by a hollow flag icon next to their status circles (items flagged directly have a solid flag instead).

#13

Total fangirl squeal! Thanks for inviting me to the beta - I can’t think of a better time to join testing! I have plenty of templates for OF which were set up for the AppleScript option - I’m really looking forward to migrating them to Editorial/Taskpaper and testing this out.


#14

This looks pretty impressive. Is there a way to do subproject in a template? (My initial attempt has crashed the beta, but I’m not super familiar with task paper and don’t see any subproject documentation about it).


#15

It looks like you indent at different levels to indicate different projects, with hyphens starting the new lines. This worked for me in beta, I exported using the share section of the project and ran that through the Editorial workflow. It had no trouble making the sub projects.

In the above, Messenger Bag is a sub project of Pack, which is a sub project of Trip.


#16

Looks like that in app, this is the project created by the workflow. (New users can only post one picture per post.)


#17

Thanks, Ken. Will there be an @repeat(1d/m/y) syntax to specify repeat intervals for items? That would be useful considering it would be difficult to add in later.


#18

Q1 answered: UPDATE: @parallel(false) … doh
How will it be possible to specify a sequential or parallel subproject, please?

Q2: Will it be possible to NOT include some tasks based on a particular variable? E.g. if I have a project to list all the things I need to pack for a trip, then I might say ‘in country or overseas’, and based on that answer I would include or exclude the ‘pack passport’ task.

Q3: Also, this is all well can good for iOS, but will I be able to take my taskpaper document from dropbox when on OSX and prep a project there? It’d be an annoyance to have two different source templates, one set of templates for both platforms is desirable (even if they are processed in different ways)


#20

Yes. Starting with the next build (r259064), you’ll be able to round-trip repeat intervals to the TaskPaper format.

The template script I’ve written is just a sample: folks are certainly welcome to customize it to do more than fill in placeholders!

OS X doesn’t have the same ecosystem (no Editorial app, for example), but all of the OmniFocus work will be coming back to the OS X app.


#21

I’m not familiar with editorial scripting, but I’ve had a look, and it looks like it’s a python script. So, as you suggest (cheers!), it wouldn’t be beyond the wit of man to

a) tweak this to allow conditionals
b) write a similar script on OSX to draw on the same files, assuming OSX has the same URL scheme?

Unfortunately, right now, I’m not the guy for that :)

Further questions:

Does the URL scheme support ‘set the autocomplete flag on or off’?

Also, can I automatically put a project in a folder? (I’m not in testflight, as I need things to be tried and true… but really looking forward to this!)