Return output to Shortcut

I have a Shortcut which calls this scriptable script but I can’t get any output back to the Shortcut.


var myTextInput = new Alert();

myTextInput.title = "CAGR:"

myTextInput.addTextField("Start")

myTextInput.addTextField("End")

myTextInput.addTextField("Years")



let inPut = await myTextInput.presentAlert();

Start = parseFloat(myTextInput.textFieldValue(0));
End = parseFloat(myTextInput.textFieldValue(1));
Years = parseFloat(myTextInput.textFieldValue(2));

a = ((Math.exp(Math.log(End/Start)/Years)) -1)*100;

Script.setShortcutOutput(a)

Safari.open("shortcuts://")

You would want to use the system clipboard for that.

See the various data transfer options I walked through here in response to another question about working with Shortcuts and Scriptable.

In regards to this specific scenario, Simon’s further clarification for me on Twitter explains how there is a limitation … which is why you are effectively forced to use the clipboard for that approach.