I am experimenting with CallbackURL in a short script that calls one of my shortcuts to perform modulo arithmetic and return the value to Scriptable.
I am running the script from within the editor and it works as expected on the first run. However, subsequent runs fail with “Error: XCallbackURL is not supported in Siri.” until the editor is closed and re-opened, At that point the same behavior is observed: only one successful run is possible.
It seems that some data is persisting between runs, but I don’t know how to reset it, and would have expected that the call to new CallbackURL would have re-initialized everything.
Here is the script:
// call shortcut "modulo JS" via x-callback
const baseURL = "shortcuts://x-callback-url/run-shortcut?";
const cb = new CallbackURL(baseURL);
const scName = "modulo (JS)";
cb.addParameter("name", scName);
const param = JSON.stringify({a:42,b:10});
cb.addParameter("input", "text");
cb.addParameter("text", param);
const response = await(cb.open());
console.log(response.result);
// first run in editor: 2, as expected
// subsequent runs (until editor is closed and re-opened): Error: XCallbackURL is not supported in Siri.