1
Source: https://github.com/Jediweirdo/Shortcut-Peramaterizer/
A Scriptable script that passes data given to a shortcut of choice. Made to take advantage of Scriptable's https:// URL launch scheme for forwarding content to Shortcuts on services that don't support custom/app URLs
I JUST realized I spelled the name wrong and it's killing me because it's too late to change it
Because to get a Wikipedia API key, I needed to make an OAuth login flow from scratch. Part of that process involved providing a redirect link for Wikipedia to tack the authorization code I need onto, but I quickly realized two things:
code parameter to the URL. Shortcuts doesn't accept any input not in the input or text URL parameter, so even if I could add the shortcut:// redirect, the actual important part would be ignoredAs such, this project was born
As stated before, this script isn't made to be run manually. Instead, you should run it with parameters from a scriptable URL Scheme. The required base format is as follows:
scriptable://run/shortcut-paramaterizer?name=[Shortcut Name]&input=[Input Type]
If you want to start the redirect with https://, then it goes as follows:
https://open.scriptable.app/run/shortcut-peramaterizer?name=[Shortcut Name]&input=[Input Type]
To quickly explain each required field:
name= - The name of the shortcut you want this to openinput= - The input type of the Shortcut ("Clipboard" or "Text" is supported)You can also add the Scriptable-specific URL parameters like openEditor and ScriptName without fear of it being added to the shortcut's input dictionary
After that, you can add as many parameters as you want to pass into the chosen shortcut. The format is as follows:
[Base Scriptable https:// URL]?[First Parameter's Name]=[First Parameter's Value]&[Second Parameter's Name]=[Second Parameter's Value]...
Note the ALL CONTENT IN BRACKETS MUST BE URL ENCODED!!!
For further reading, check out Scriptable's URL Scheme Docs and Apple's Shortcut URL Scheme Docs
You can install this script through Shareable.
Alternatively, you can manually install this by downloading the Latest Release and sharing the corresponding .scriptable file with Scriptable and selecting "Add Script"
To build shortcut-peramaterizer, simply download the JavaScript code to your Scriptable-installed device and move the file to wherever the Scriptable folder is saved on your device. For me, it's iCload Drive://Scriptable
And You, for checking this out :)
name and input keys in case you need to use those for something elseDon't hold your breath waiting for this, though. I'm probably never updating this again unless there's a bug or something. Like I said before, I hate JS and only touch it when I need to
Contribute if you want, but no promises that I will merge it. I don't exactly expect to be active on this repo...