(Solved) Can omnijs be executed by Shortcuts app?

Hi everybody,
I would like to append text to an existing OmniFocus task via shortcuts. So I downloaded ‘Append to Note’ script from omni-automation.com . It works fine when using it interactively with the “Share” button. However, I would like to execute the script within shortcuts with a parameter (text to add to the note). Is this doable? So far I found no documentation on how to do it.

I also could do it with

  1. get the information from the specific task
  2. append the new text to the existing text
  3. create a new activity
    But then I do not know how to delete the “old” task with shortcuts.
    Any ideas about that?

Yes, it’s quite easy to run an Omni Automation script from iOS Shortcuts. You need to open a URL of the form:
omnifocus:///omnijs-run?script=

The script parameter can be an entire complex script or just a call to one of your installed plug-in actions (URL-encoded in both cases).

The following is an old page based on the Workflow app but the techniques showed continue to apply:
https://omni-automation.com/workflow/

Since you want to pass an parameter (your note text), I recommend studying this page about the new script security mechanism and how it manages arguments to functions which you call from outside OF:
https://omni-automation.com/script-url/index.html

These older pages with some examples could also be useful:
https://omni-automation.com/shared/url-app-to-app.html
https://omni-automation.com/script-url/form-example.html

— wow, thanks a lot for the speedy and comprehensive answer, MultiDim!!! I think, this really solves my problem. Have a good day!

1 Like