Stupid newbie question: How to access parameters passed from other Shortcut steps

I suspect - like many - I’m strapping together lots of these lovely 3rd party suites of functionality together to gather data and send them to Scriptable for processing.

I have some data extracted from the web using Gizmo, and I want to pass a text string into a Scriptable script. In Shortcuts, I have the ‘Scriptable Run … with (parameters)’ step, and I put in the correct string variable as a parameter. Under ‘more’ for this step, I have the (same) variable name entered under ‘Texts’.

How do I access this in the Scriptable runtime? I’ve hacked around at the args.plainText object, args.plainText[0], args.plainText["correctVariableName"], but to no avail. Any pointers hugely appreciated!

Here’s a simplified example that might help.

Shortcut

https://www.icloud.com/shortcuts/21b063d6aeac4eb190fa211f4d1843cc

Scriptable Script

Script is named Param1 in Scriptable:

return args.shortcutParameter + " bar";

Result

Note, depending upon what you want to do, the inline script action may also be an option in which case you can drop a Shortcuts magic variable directly in between some string delimiters in the inline script.

Hope that helps.

2 Likes

Ooh! Thanks, I’ll take a look at this (checks watch) oh… this afternoon!

Hey, thanks @sylumer - just the nudge I need, and thanks for the reminder about inline scripts!

leaves a low-sugar gluten-free vegan cookie for your help :cookie: