Add todos to OmniFocus

Doing some addition investigation I found the Shortcut breaks if certain characters are in the Agenda To Do list. The note that was breaking the Shortcut had the word “P&ID”. If I remove the ampersand, both the original and my modded short cut works. Adding the normal acronym back into the note and the Shortcut breaks.

Next step is to add some regex checks for certain characters.

It sounds like there’s a URL encoding step missing that turns the ampersand into the correct encoded URL characters.

Haven’t had this issue before.

Here is an updated version:
https://www.icloud.com/shortcuts/5395fb0604174e51b7e535d359d784d5

2 Likes

I would really love it if the native \remind function could be redirected to Omnifocus natively instead of reminders.

That would indeed be cool but require quite a bit of work together with the folks of Omnifocus, last time I checked they didn’t have a way to query for existing reminders through an API for example.

You are going to definitely want to check. They have a very extensive automation api now.

https://omni-automation.com/omnifocus/

For the Mac app this should definitely be doable.
But on iOS it’s probably not possible.

iOS has the same automation framework above.

Yes, but the automation framework you’ve linked is for automations inside the app.
Afaict it isn’t possible to use this api from other apps.
On the Mac however the AppleScript api could be used to create and get tasks.

On iOS the Share Sheet would be needed - at least on iOS 14 or less. I’m not sure about iOS 15.

Thanks for the link, very useful. I’m afraid however that the conclusions from @jandamm are probably right, we’d need something like x-callback-url support for reading the contents of your OmniFocus library. Not sure they added this since, but last time I checked you could only write things to OmniFocus, not read from it.

There is support for getting tasks using Shortcuts but I’m not sure if Agenda could run a shortcut in the “background” without the user actively triggering it.

True. My biggest use case would be the \remind shortcut to send a reminder to Omnifocus. I cloud do the “make a checklist and export the agenda note as markdown and have shortcuts parse it and then make Omnifocus tasks out of it” in the way that I have seen some people on here use shortcuts to do, which is fine. However, shortcuts doesn’t always work (crashes hard on this task the majority of the time)

It would be extra credit to read from Omnifocus, yes, but if I could just send my tasks from Agenda to Omnifocus natively without a Reminders middle ground (import from reminders), or the shortcut method, it would solve mine (and about 10 others I’ve seen on here)’s problem. Perfection is the enemy of good enough sometimes.

Don’t need to strive for full perfection if just creating tasks is what the majority need.

Totally agree. But this is currently not possible with the APIs Apple is providing.
If Agenda and OmniFocus would be from the same developer something like this would be possible.

Using url-schemes would work to create tasks in OF. But this would result in new tasks (when changing something) and it would interrupt the notes flow since it would switch apps for a second or so.

I haven’t had a deeper look at the APIs of iOS 15 so it might be possible then.

1 Like

This shortcut is fantastic. Is there a way to pass the Agenda note link to the Notes field in OmniFocus so that linking is bidirectional?

Not sure if sharing the sheet actually passes the note url.

Thanks!

No currently not.
The last time I checked it wasn’t possible to get the notes url and content.

With full Shortcuts support in Agenda it would be possible to share the notes ID, then get the content in Shortcuts and then continue with the current script.

Also this idea here was pointed in this direction to get A) faster access and B) more information of the note.

I have further improved the version: icloud.com/shortcuts/d2fc9aab11bc458390982852c0b6dcba

  • Now the item in OmniFocus contains a link to the agenda note.
  • The note title isn’t prepended to the note anymore*
  • The Shortcut also works when the item is on the agenda*

* I’m not sure if those are issues that were introduced by a newer version of Agenda

Unfortunately the newlines aren’t stable to and might change when reimporting. I’m not sure whether the issue is in the export, my shortcut or the import.
Also horizontal lines aren’t preserved. Those aren’t exported by Agenda when selecting Markdown.

1 Like

Had a quick look…
It seems the newlines don’t survive the import via the url-scheme.
They are decoded as %0A which a default url decoder converts to a newline.

I’ve further improved the Shortcut: Shortcuts

  • Done notes are now supported as well.
  • It now also adds done todos to OmniFocus (and they’re done there too).
    They won’t be marked differently in Agenda however. Once they leave Agenda I consider the state represented in OF. If you know a bit of shortcuts you could easily change the appearance in case you care.

Currently todo’s which have a reminder will be replaced as well.
They have a # appended. I’m not yet decided how/if I should handle them - feel free to share your opinion :slight_smile:.

4 Likes