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

I think i’m missing something. I tried that workflow you included but it didn’t automatically add the task. I still had to confirm it in Omni Focus. Is there a way to have it add on its own?

Also, for the due parameter how should dates be formatted?

+1 for conditionals

I would also love to see conditionals in here as well. I use the Populate Template Placeholder’s script from @curt on a regular basis on my Mac. I still can’t figure out why ANY scripts, (including PTP), running through OF still take a long time to complete.

When I tried the new setup through Editorial, it completed in no time at all.

I’m still trying to shift my main daily driver to my iPad Pro (big boy), and having the ability to do this would help me out considerably.

If someone who knew their stuff would write the script, we could define our own conditional format… as I understand it, the list is all preprocessed in python and then passed to OF as a long URL… so the python script can do whatever.

However good this is, I think I’d prefer if templating was fully baked into OF rather than relying on a script… however the URL scheme does allow people to make their own workflows without waiting for Omnigroup to make it.

I am not a dev but I probably know enough Python to take a look at conditionals if you can post an example of the kind of thing you’d like to do with them.

Can you give an example for the /paste url please ?

The sample Editorial workflow that Ken posted in the first post uses a paste url to get the content from Editorial to OmniFocus. It opens the url:

omnifocus://x-callback-url/paste?target=projects&content=encodedContent

where encodedContent is TaskPaper text that has gone through Editorial’s built-in “URL Escape” Action so that it can be appended to the URL safely.

Thanks ! I’ll have a look. I couldn’t see the Editorial sample as I don’t have the app (yet).

It is not immediately obvious to me how to add the special characters «» when typing using the standard iOS keyboard interface. Is an external keyboard required for this?

If you’re using the standard English/US on-screen keyboard on iPad, tap shift and then touch and hold the " key to access « and » (if you don’t tap shift first, your only option will be "). I imagine this is similar for other locales.

1 Like

Ah, thanks Dave! In looking for «», I think I used the touch-and-hold gesture on nearly every other symbol ()[]{}<>, but somehow I still missed it. Works on iPhone too. Appreciate the quick clarification!

Maybe someone can double check my workflow? I’m trying to implement a “Follow up with _______” task using an existing task as input. The workflow is here…
https://workflow.is/workflows/fe465942b3884201abe1cddbb95deb46

Problem is after the workflow finishes running, OF gets stuck on the inbox screen, preventing the user from doing much else. I’m using the latest April 14th build. Is this a bug or a blunder on my part?

What are the possible values for “target” ?

Will it be possible to complete an action with the new URL scheme ?
Now we have the id of any action, this could allow us for example to create workflows that mark the current action as complete and create a new one based on the completed action. This is typically interesting for waiting for/follow up.

I’ve not used Taskpaper or Editorial (so excuse my ignorance). Do we need to use the Taskpaper app to create these project templates, or can we use a plain text document to create the formatting for these templates?

From what I can see the formatting looks easy enough to understand and do. Just wondering if I could do without Taskpaper and just buy Editorial to use templates, or does Taskpaper export a specific file format that Editorial imports, so copying from a plain text document wouldn’t work?

Editorial can create and edit task paper files on its own.

The official Task Paper app on the Mac uses .taskpaper files.

1 Like

TaskPaper files are plain old text files. You can open them with any text editor. I use Sublime Text on the Mac.

1 Like

That’s a bug! It will be fixed in the next TestFlight update (r259359 or later).

That said, there are a few issues in that workflow that you’ll want to fix:

  • Workflow will happily return URLs embedded in the original TaskPaper text, so (unfortunately) you can’t assume that the first URL is the detailed task URL. Right now, though, it’s guaranteed to be the last URL that includes a query, so if you loop through the URLs and scan their queries you can guarantee that the last one is the one you want.
  • The task name and project name parameters need to be URL-encoded before putting them in the URL to send back to OmniFocus, otherwise a space in the task name will break the URL.

Here’s an edited version of that workflow which fixes both of those issues:

Currently, the only meaningful values are “projects” or “inbox”. But in the future, I’m thinking it would be useful to be able to specify the URL of a parent folder/task/project.

It’s not possible in the current TestFlight, but I certainly agree this would be useful. In fact, I’d love to add an /edit action that would take the same parameters as /add but let you change existing tasks.

However, /edit would need some careful design to avoid data loss. One of the great things about /add is that it’s never destructive: it only adds new information to your database (and shows you what it just added), it never changes what’s already there. With an /edit URL, we would probably want some sort of confirmation to let you know what it’s about to change.

As @zemackdaddy notes, you don’t need the TaskPaper app at all, everything can be done in Editorial. In fact, you don’t really need Editorial either: it’s just a conveniently scriptable text editor that lets you automate the process of generating the content you want from a template.

All you need is to copy text from somewhere and paste it into OmniFocus. (The /paste URL automates the paste and specifies a target, which is great for automation, but you can also paste by hand in the app.)


I think we’re getting close to being feature complete for this update. Obviously there are more things we could do (like the /edit action I mention above), but I’d love to get the capabilities already present in the current TestFlight out to all of our customers.

Is there anything else that you all see that really should be fixed before this becomes available to everyone? I think the biggest awkwardness on my list is fixing our date parsing so that “2016-07-01 -3m” is correctly interpreted as “2016-04-01”. Though even that isn’t necessarily a showstopper, since the script that builds a project from a template could parse and resolve those dates before sending them along to OmniFocus.

2 Likes

Excellent thinking.

Not a script editor per se, but I plan on using Drafts a lot with this OF URL feature.