Implementation Details for OmniFocus 2.14 Automation

Hi @kcase,

Thanks for all this awesome work on improving OmniFocus!

Two quick questions:

  1. Is there a way to use taskpaper via Maildrop (ie. by sending an email to username.secret@sync.omnigroup.com)?
  2. This is a Pro feature on iOS, correct?

Thanks again!

With todayā€™s release of OmniFocus 2.15, the autosave=true parameter is now in the shipping app.


  1. Not yet, though weā€™ve been thinking about how to add that to MailDrop in the future.

  2. Automation URLs to add tasks donā€™t require Pro. We wanted them to be available to everyone.

1 Like

[EDIT : just saw this thread]

With todayā€™s awesome update (2.15), we have gained more power with the autosave=true parameter. Thanks for that addition !
However, we canā€™t get enough of those new abilities and this one makes me want another one.
@kcase, what would you think of the ability to edit an existing action ?
I have a pretty useful Workflow that allows me to create an action from an existing one. The existing action would be :

Mail Ken RE: add a new URL action to modify an existing item

My workflow is launched from this action and I would like to do the following :

  1. (this is already done in the current version of my workflow) Create and save (thanks to the new autosave parameter) a new action with the Waiting For context set, and the following modified title :

Waiting for Ken RE: add a new URL action to modify an existing item

  1. Automatically mark the current action to done (this step is done manually in the meantime) like so :

omnifocus:///task/abc123/edit?completed=now&autosave=true

I think there would be a lot more of use cases which could benefit from this edit URL action.

Thanks !
Seb

2 Likes

@context(Context : nestedContext) does not work for me. Only non-nested context does. I work with the german version of OmniFocus. Could this be the reason? Thanks! Moritz

great idea!

OmniFocus 2.16 for iOS is now in TestFlight, with support for using specific folders or projects as targets for /paste URL actions. Enjoy!


Yes, I totally agree: right now, the iOS app only supports automating the ā€œCreateā€ part of the traditional set of database operations (unlike the Macā€™s support for AppleScript, which can Create, Read, Update, and Delete). We want to flesh that out completely eventually, but itā€™s not at the top of our roadmap yet. (Thereā€™s only so much harm someone can do with Create, but we might want a stronger security model in place before allowing those other operations.)

The separator is actually a synced database setting that used to be controlled by a visible preference in OmniFocus 1. Is it possible you customized it in your database at some point?

Have you tried copying a task which has the nested context assigned to see what it looks like on your device? You can do this by editing the task, using Share > Copy, then pasting the text into a plain text context (such as a note in OmniFocus, or a text editor in another app).

1 Like

I am way behind on this feature. Are there any tutorials on using the new template system in iOS? Only reason I keep my air is because of applescript.

The first that comes to mind is David Sparkā€™s OmniFocus field guide that he has updated to include a section on TaskPaper templates.

4 Likes

Thank you. I donā€™t know much about programming so the thread is intimidating. However I love David Sparks so I am sure it will be beneficial. Thanks again!

The latest Mac beta claims that Taskpaper paste works in 2.7 but I havenā€™t had any luck with it.

Update (2016-09-03 18:47) I realized that itā€™s the text that gets copied. Duh. I canā€™t wait for the Mac app to get the automation attention that the iOS apps have been getting.

Is there a website that hosts popular templates for taxpaper?

Is there a way to do multiple operators on TaskPaper date/time math? Iā€™d like to set tasks due a certain amount of time (say, 10 min) before driving to a meeting, based on travel time, with Ā«meeting dateĀ», Ā«meeting timeĀ», and Ā«travel timeĀ» as template variables, e.g.:

Sample task: - photograph odometer @due(Ā«meeting dateĀ» Ā«meeting timeĀ» -Ā«travel timeĀ» -10 min)

My experiments havenā€™t produced anything useful.

On iOS, you could use Workflow to essentially capture values and do find and replace on placeholders.

I think Editorial has this built in as well, Drafts might, too.

On Mac, I donā€™t know anything about AppleScript, so I would just execute a couple of find/replaces, but smarter people than me probably have a more elegant approach.

ScottyJ

The latest TestFlight notes says that pasting taskpaper now accepts existing projects as targets. Does the taskpaper layout need to change to incorporate this, or would OF be able to recognise an existing project and add the tasks accordingly?

If we were using your Editorial workflow, does that (the python code etc) need to be updated?

It looks like you would just need to edit the workflowā€™s last step (URL generation) to change the paste target.

Sorry to be a pain, but Iā€™m on 2.16 now, and I still have no idea how to specify a folder within my taskpaper template.

Iā€™m also keen to find out if I can use the same taskpaper template on OSX.

1 Like

Hi, and thanks for this functionality!
One question: A loooong time ago I had a script from Rob Threw for getting Merlin Project activities into Omnifocus. Unfortunately, I donā€™t have that anymore, but this script had one fantastic feature that I wish would work in your scheme: It identified nested contexts.

In practice that meant it was sufficient to feed Omnifocus with the name as context, although the full context name in Omnifocus could well be something like . Omnifocus would be able to identify where it belonged in a nested context structure. Is it possible to do something with that?

All the best,

Arild

@kcase when using the /paste URL function, how do I use x-success to change the view to a particular context in omnifocus?

You could do something along these lines:

omnifocus://x-callback-url/paste?x-success=omnifocus:///context/CONTEXTNAME&target=/task/PROJECTNAME&content=TASKPAPERCONTENT

Thanks Iā€™ll try that.

LATER EDIT:

Having problems.

I took a URL that worked in Drafts, duplicated it, and replaced

omnifocus:///paste?target=task/ERRANDS

with

omnifocus://x-callback-url/paste?x-success=omnifocus:///context/TEST?target=task/ERRANDS

and I got an INVALID URL error from Drafts. The original URL runs fine without the x-success function.

This is probably a syntax error. Any idea what part I put in the wrong place?