Use x-callback-url with Shortcuts
Shortcuts supports x-callback-url, allowing the calling app to receive a response (a callback), when a particular interaction has completed. You can run shortcuts from an x-callback-url using the same parameters as discussed in Run a shortcut using a URL scheme. For example:
Per the X-Callback-URL standard, the following additional parameters can be provided:
x-success (optional): An URL that opens when the interaction is successful — for example, after a shortcut is imported or has finished running. If a shortcut is run, a parameter named
resultis appended to the URL and contains the textual output of the shortcut.
x-cancel (optional): An URL that opens when the interaction is cancelled by the user.
x-error (optional): An URL that opens when the interaction fails because an error occurred. A parameter named
errorMessageis appended to the URL and contains a description of the error.
x-success, you can provide an URL that opens after the shortcut successfully finishes running. This could be used in conjunction with a multi-step checklist of tasks in OmniFocus, wherein you open the X-Callback-URL to run a shortcut, return to the list and move on to the next task via URL.
x-cancel, you can provide a contingency URL to launch if the shortcut stops before it finishes running. Because the shortcut did not complete, no output from the shortcut is provided.
x-error, you can provide a contingency URL to launch if the shortcut encounters an error while running and fails to finish. In this case, you can fire up a different URL to handle the issue.