Add todos to OmniFocus

I started with this shortcut for Things and adapted it for OmniFocus:

I also improved the shortcut so that it appends the links to the OmniFocus tasks to the end of the note. (It requires plain text instead of rich text now).

Here is the link:
https://www.icloud.com/shortcuts/4745885109084c18afb8b82273d34e73

I’d love to change the links behavior and would place them right in the line where the todo was before.
Unfortunately it seems that Agenda doesn’t support replacing a note with a new content. Only appending or creating a new one.
Maybe this can be added in a future release, @mekentosj ?

3 Likes

So you would like to wipe out the current contents entirely to be replaced with the new input?

Given:

hi
- [ ] todo
- [ ] next
Some text

I filter out every line with [ ] and add it to OmniFocus.

Then I would like to replace the note above with:

hi
- [todo](link)
- [next](link)
Some text

Currently I can only append having the items twice (checkmark and link).

Right, we could add this ability but it would be an all-or-nothing option, i.e. replace the entire content of the note, not replace a few paragraph and keep the rest.

Yes, this wouldn’t be an issue since I have the full text and could add the filtered lines as well.

This feature could also be useful for other use cases. Share text, reformat and write back to note.

Update: New in the upcoming version 13 update is the requested ability to replace the text of an existing note completely with that provided through the replace-note x-callback-url, see the reference here. :sparkles:

1 Like

I would love to be able to replace the native “\remind(tomorrow)” shortcut in notes so that the reminders go into the inbox in Omnifocus instead of Reminders.

Today I do this through using the \remind shortcut and then Omnifocus reads the reminder out of the inbox in Reminders and pulls it over to the Inbox in Omnifocus. Wish this was native.

I’ve updated the shortcut for Agenda 13.
You can already use it if you’re using the Agenda TestFlight version.

Having this note:

The shortcut will create these tasks in OmniFocus:

And the note will look like this (the links will open in OmniFocus):

Here is the link to the Agenda 13 Shortcut:
https://www.icloud.com/shortcuts/4205c7f8de7f4672abec34dfa1271490

4 Likes

Thanks @jandamm! This is exactly what I was looking for to push Agenda action items into OmniFocus.

2 Likes

Just check to see if anyone is having problems with this shortcut? The shortcut will run, but it won’t add tastes in OmniFocus and the note in Agenda is only partially returned after the Shortcut runs.

I thought maybe I broke something with a custom tweak, but re-downloading the linked shortcut above has the same problems.

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.