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

Would love to see this added. Sample drafts action to turn a shopping list into multiple Omnifocus tasks for those interested:

omnifocus://x-callback-url/add?name=[[title]]&parallel=true&flag=false&project=Shopping&context=errands&defer=saturday%209am&due=sunday%204pm&x-success={{drafts4://x-callback-url/runAction?text=[[line|2…]]&allowEmpty=NO&action=Shopping%20List}}&x-cancel={{drafts4://}}

Would be nice to add an auto complete flag to allow this to be 100% automated with drafts.

1 Like

I confirm that it works with top level project but not when the project is nested in one or more folders.

Create one folder named Test then inside a project named Test and run the following :
omnifocus://x-callback-url/add?name=Test%20action&parallel=true&project=Test%20:%20Test

The project won’t be set.

Have to tried omitting the path name and just calling the project itself?

&project=ProjectName instead of &project=FolderName:ProjectName

I can assign contexts by using the Editorial workflow. However, if I copy / paste the same taskpaper code from Editorial (or Drafts) into Omnifocus directly, my contexts will not be assigned (they vanish). Is it me or is @context(myassignedcontext) disappearing when doing a copy / paste of taskpaper text into Omnifocus?

It kinda works. But it has its limitations :

  • if you have two projects with the same name under different folders, which one will be set ?
  • when you copy an action from an existing project and analyze the url generated, you have something like this :
    &project=folder%20:%20projectName

What is generated is what we should be able to do : specify the full path of the project in my opinion.

FYI, I’ve posted implementation details for the URL Scheme and TaskPaper format over here:

Questions and feedback welcome!

3 Likes

Being able to specify the full path was certainly the intent! We’ll try to get this fixed soon. (If not for 2.14, then for the inevitable 2.14.1.)

1 Like

found my mistake. only works with toplevel contexts

I have 2 questions here:

  1. Why the duration and repeat parameters are not supported?
  2. What’s the usage of parallel parameters in this URL:

omnifocus://x-callback-url/add?name=some%20name&note=some%20note&parallel=true

I believe that parallel is just one type of project. Since the URL still couldn’t create a new project that doesn’t exist in OF, set parallel true or false in the URL seems doesn’t matter at all.

As for projects, I hope this will be fixed so we can specify the full path for contexts.

It can be used also for group action.

It seems as though the bug above has been fixed, although I’m still having issues creating a new action from the “Add While Busy” workflow. Worthy of mention – I appended a “Copy URL to clipboard” step to the end of the workflow, and the URL works fine when running from Safari but not when being passed back from Workflow to OF.

You can specify both the estimated duration (using estimate) and the repeat (using repeat-method and repeat-rule).

For more detail, please see the implementation details post:

The parallel and autocomplete settings have no effect when a task is first created. But if you ever break this task down into subtasks, these settings will become active.

If you share an updated copy of the workflow you’re using, I’d be happy to investigate!

1 Like

Here is the workflow: https://workflow.is/workflows/ff246e32c85b452d85e7b259c02d6e3f

On second glance, it actually looks like the two bugs I mentioned previously are still an issue:

  1. After running the workflow, OF doesn’t allow editing of any actions. It instead reverts back to the project view of the action selected for editing.
  2. Also, when going to “Search” after the workflow, the magnifying glass icon in the search bar moves to the middle of the search input and doesn’t allow any typing.

These two bugs are in addition to the URL not launching correctly from the Workflow app to OF (although it works from Safari to OF).

Hmm, that workflow worked just fine for me just now. But maybe it’s a device-specific issue? I’m using an iPad, what device are you using?

Oh, and I guess I’m also using a test build of Workflow. Ari and I worked on solving some issues and it’s possible that you’re running into one of the things he fixed in these builds.

1 Like

I’m using an iPhone with iOS 9.3.1.

Just because it has not been mentioned yet: if you use Drafts with OmniFocus and also have TextExpander installed, you can prepare project templates with fill-in snipptes. One made-up example:

- %filltext:name=Workgroup%: Introduce %filltext:name=App% @parallel(false) @autodone(true)
    - Install %filltext:name=App% @context(%filltext:name=Workgroup%)
    - Received questions about %filltext:name=App%? @context(Waiting) @defer(next Friday)
    - Prepare FAQ for %filltext:name=App% @context(Office)

You have to enter Workgroup and App only once, Textexpander will then paste the complete project into Drafts. In Drafts, you just have to create the following URL action to send it to OmniFocus:

omnifocus://x-callback-url/paste?target=projects&content=[[draft]]

You can of course tweak the URL to your liking.

4 Likes

Excellent idea, I’d not thought of doing it like that through Drafts 👍🏼

The latest TestFlight build fixes this: you should now be able to specify the full path to a project or context in the /add URL action.

I just tested on my iPhone, and was able to reproduce the problem when using the shipping build of Workflow. The good news is that it’s fixed when using the test build of Workflow.