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

What I didn’t realise until today (because I’m not a dev) is that with the provided Editorial workflow, I can add any parameter I need as part of an action and then add it into further actions,

e.g. I started to set up separate taskpaper projects for different types of meetings which effectively have the same actions. I’ve now got one taskpaper project in Editorial which I’ve set a parameter for type of meeting and another for different roles in the meeting which can just be filled in when I run the script.

Things just get easier and easier :-D.

Really helpful, thank you.

When I copy and paste a project out of Omnifocus I’ve noticed that the tasks and projects that were marked to complete when all of their sub tasks are done come up with a tag of @autodone(false). but when I paste that same project back into OmniFocus the task / project doesn’t complete when its sub tasks are done.

Is anyone else seeing this problem?

It seems to work if I manually change the tag to @autodone(true)

Whoops, thanks for reporting that bug! The archiving code was writing out that setting as the exact opposite of what it should have been. This is fixed for the next update in r259861.

I think there may be a weird problem with the TaskPaper parsing when dealing with large projects. I’m running build 259670, which seems to be the latest, and when I try to round-trip a project out to TaskPaper and back — even if I don’t make any modifications — I’m ending up with a bunch of the tasks being duplicate in the Inbox.

For example, I was using a single action list of household chores just to test the TaskPaper aspects, and everything landed in Editorial in TaskPaper format without any problems. A total of 152 tasks, of which 122 have been completed. Everything looks fine in the TaskPaper file as far as I can tell, but when I re-import that same project back into OmniFocus (with only the name of the project changed), either using the Editorial workflow or simply by pasting it in, I get an additional 102 tasks from that project duplicated in my INBOX, with all of the properties intact except for the Project.

The closest thing I can see to a pattern is that the duplication may be a result of the way it’s parsing tasks of the same name. For example, a quick run of the TaskPaper file through sed/uniq to filter on just the task name reveals about 45 unique lines out of the 152 tasks, and a couple of counts of the results I’m seeing in the INBOX would seem to suggest that what OmniFocus is doing is taking all of the tasks in a same-named series and duplicating every task except the first into the INBOX.

For example, if I paste the following TaskPaper snippet into OmniFocus, I’ll end up with the correct project in place wherever I paste it, but I’ll also get the last three tasks duplicated in the INBOX, with all of the correct properties in place except for completed status and project.

test Household: @parallel(true) @context(Home)
- Task @flagged @context(Home : Arriving Home) @due(2016-04-07 17:00) @defer(2016-04-07 08:00) @repeat-method(fixed) @repeat-rule(FREQ=WEEKLY) @done(2016-04-07 20:09)
- Task @flagged @context(Home : Arriving Home) @due(2016-04-14 17:00) @defer(2016-04-14 08:00) @repeat-method(fixed) @repeat-rule(FREQ=WEEKLY) @done(2016-04-14 16:25)
- Task @flagged @context(Home : Arriving Home) @due(2016-04-21 17:00) @defer(2016-04-21 08:00) @repeat-method(fixed) @repeat-rule(FREQ=WEEKLY) @done(2016-04-21 18:22)
- Task @flagged @context(Home : Arriving Home) @due(2016-04-28 17:00) @defer(2016-04-28 08:00) @repeat-method(fixed) @repeat-rule(FREQ=WEEKLY)

This behaviour only seems to occur if at least one of the items is marked as @done in the TaskPaper source document, and the logic currently seems to be to skip the first @done item, and then grab as many items after that as there are items marked @done. So if the first items 1-5 of 8 are marked as @done, OmniFocus will duplicate items 2-6 in the INBOX. Interestingly, however, in that scenario, OmniFocus will use the names of tasks 1-5, but the dates of tasks 2-6. In other words, given a TaskPaper document like this:

test project: @parallel(true) @context(Home)
- Task 1 @flagged @context(Home : Arriving Home) @due(2016-03-10 17:00) @defer(2016-03-10 08:00) @repeat-method(fixed) @repeat-rule(FREQ=WEEKLY) @done(2016-03-10 19:00)
- Task 2 @flagged @context(Home : Arriving Home) @due(2016-03-17 17:00) @defer(2016-03-17 08:00) @repeat-method(fixed) @repeat-rule(FREQ=WEEKLY) @done(2016-03-17 19:00)
- Task 3 @context(Home : Arriving Home) @due(2016-03-24 17:00) @defer(2016-03-24 08:00) @repeat-method(fixed) @repeat-rule(FREQ=DAILY) @done(2016-03-24 19:00)
- Task 4 @flagged @context(Home) @due(2016-03-31 17:00) @defer(2016-03-31 08:00) @repeat-method(fixed) @repeat-rule(FREQ=WEEKLY) @done(2016-03-31 19:00)
- Task 5 @flagged @context(Home : Arriving Home) @due(2016-04-07 17:00) @defer(2016-04-07 08:00) @repeat-method(fixed) @repeat-rule(FREQ=WEEKLY) @done(2016-04-07 19:00)
- Task 6 @flagged @context(Home : Arriving Home) @due(2016-04-14 17:00) @defer(2016-04-14 08:00) @repeat-method(fixed) @repeat-rule(FREQ=WEEKLY) 
- Task 7 @flagged @context(Home : Arriving Home) @due(2016-04-21 17:00) @defer(2016-04-21 08:00) @repeat-method(fixed) @repeat-rule(FREQ=WEEKLY) 
- Task 8 @flagged @context(Home : Arriving Home) @due(2016-04-28 17:00) @defer(2016-04-28 08:00) @repeat-method(fixed) @repeat-rule(FREQ=WEEKLY)

The INBOX will contain tasks named Task 1, Task 2, Task 3, Task 4, Task 5, but the dates will be from Task 2, Task 3, Task 4, Task 5, and Task 6, respectively. Other properties such as flagged status, repeat interval, and context appear to match the task names, however (e.g., Task 3 is unfledged and has a daily repeat interval, but the defer date and due dates are set to the dates from Task 4.

I recognize that this is something of an edge case — I’m not sure there’s a need to import completed tasks most of the time, but I can see if happening if somebody is trying to round-trip a project to TaskPaper to make modifications and send it back into OmniFocus “as-is” — in my case I was kind of taken aback to suddenly have over 100 items in my INBOX, all of which were overdue (as they were previously completed items :) ).

For those who only use Workflow, here is what I do instead of using Editorial as demoed by Ken Case.

I have a folder named “Templates” in which I store all my templates projects :

A template project looks like this :

You can see the placeholders which can be put anywhere you want.
Now if I want to generate a new project based on the template, I tap on the name of the template project and then I call the workflow from the sharing menu :



The workflow detects the different placeholders and ask for your input for each one. And voilà ! The project is generated as you expected :



The workflow is very basic and is a proof of concept.
You can download it here : https://workflow.is/workflows/f0343180a4624d529951b06e6bfc2a35

Now you can manage all your templates from within Omnifocus and review them as you wish.

8 Likes

I’m having similar symptoms and I’m not sure this is only a Workflow issue. The reason is that I basically need to kill and restart OF after running (or rather trying to run) a workflow in order to make it usable again.

Hi Ken

I would consider myself someone who uses almost every aspect of OmniFocus to it’s full potential. The only thing I’ve never really played around with is automation. I see massive potential in using automation but feel pretty confused and overwhelmed by it all. I don’t really know what editorial is but I do use workflow on iOS a little. When these new automation features are released is there going to be a blog post that explains how to get started? Some getting started videos would be pretty helpful. I can’t think of another task management app that offers the kind of flexibility and customization that OmniFocus offers. I’d gladly pay over $200 for it because of the peace of mind it brings to my life. Great work!

Thanks

1 Like

You didn’t ask me, but I think a good place for you to start is to first think about things you do with OmniFocus (or related to planning) and ask yourself if there is something that you would like to see take less steps or time.

I would rank the top three maybe.

You might find that things are fine the way they are.

2 Likes

Hmm, yes, there seems to be an issue where OmniFocus can get confused into thinking it’s in the middle of editing an action when it isn’t, and if you perform an /add URL action while this is happening then it will dismiss any editor you enter within one second. (I’ve only ever seen this happen on iPhones, but maybe it could also happen on an iPad if you’re using it in a narrow side-by-side configuration.)

We’re working on tracking this down so we can fix it in the next update.

You can apply for a beta version on the Test Signups page.

1 Like

You actually can drill down into Contexts, but you have to specify with space-colon-space. An example would be:

Parent Context : Child Context

In this case you would be setting the action to have the Child Context. If you go into the context picker in OmniFocus, you’ll see the plain text output of the hierarchical contexts listed there. Find the context you need and then you can type it out in full, colons and all, into a workflow. Hope that helps!

1 Like

bryan did you ever get an answer for how to type «» characters on iOS keyboard??? I’ve looked everywhere and, other than copy/paste can’t figure our where/how to type those characters.

Press and hold on the " key - they’re French quotation marks.

1 Like

awesome, thank you… I had already tried press and holding every key, including the ", because I just knew they were there somewhere… just figured out that some of the keys, including, of course, the " key, I had force-touched, i.e. pressed too hard. press and hold the ", force-press gets you cursor control. thanks again.

If anyone is using an external keyboard (or working on a Mac) and hasn’t found the shortcuts for «», they are ⌥\ and ⇧⌥\

1 Like

Hi there.

I have used your Workflow solution to enact templates and it all works fine, except it dumps the project in the ‘Inbox’.

Is there as way that it can put the project in a different place?

Cheers for the upload.

Hi Adam,

As per the documentation, you can have two targets for the pasted actions : inbox or projects. Please feel free to modify the workflow to suit your needs.

/paste - pastes a hierarchy of items into the Inbox or project list
target=target - use inbox to create new inbox items, or projects to create top-level projects

1 Like

Thanks for that - got it working :D

1 Like

Bug report, I guess?

I have a structure that looks like the following. Assume that both contexts are already defined in the database:

- Project Name @context(office)
    - Subtask 1
    - Subtask 2
        - Sub-subtask 1 @context(office : Boss)

Subtasks 1 and 2 inherit the “office” context, but sub-subtask doesn’t get a context assigned, even when explicitly declared as above.