The technique I’m going to explain does have limitations in terms of the data it can access and the format it can release to Shortcuts. It’s text all the way, but as long as you are careful you can use base64 to transfer non-text items, such as images, in a text-based format.
We can use a Data URL (ref. Data URI, Wikipedia) to actually define a whole web page in a URL. It sounds bizarre, but it’s true, and it was actually used by the Workflow team (before the were aquired by Apple and the app changed to Shortcuts) to build pages where you could save home screen bookmarks to launch Workflow workflows.
- Shortcut: EvalJS.
To illustrate how this can be used, I’ve created a test shortcut that utilises the shortcut above.
EvalJS shortcuts, and the result captured to a variable.
Finally the results are displayed to the user in a pop-up.
- Shortcut: EvalJS Test