Shortcut Peramaterizer

Created by Jediweirdo

1


Download

Informations

Author: Jediweirdo

Downloads: 7

Stars: 1

Type: Script

Published on: 19 May 2025

Description

Shortcut Peramaterizer

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

Why?

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:

  1. Wikipedia doesn't allow app URLs to be redirect links
  2. Wikipedia gives the authorization code by tacking on a 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 ignored

As such, this project was born

Features

  • Automatically assembles and launches the Shortcut URL upon successful launch
  • Automatically parses out Scriptable URL parameters so they don't get passed to your Shortcut
  • Really Basic Error Detection
  • Supports both text and clipboard Shortcut URL scheme input types
  • That's about it

Usage/Examples

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 open
  • input= - The input type of the Shortcut ("Clipboard" or "Text" is supported)

You can also add the Scriptable-specific URLs 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:

[Required parts of 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

Installation

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"

Bulding

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

Acknowledgements

  • Gluebyte and the helpers on the Shortcuts Discord for helping me troubleshoot this
  • Scriptable Docs for showing me the ropes
  • A JS/Scriptable Docs reference sheet generated by ChatGPT because I hate JS And You, for checking this out :)

Roadmap

  • Integrating Shareable's Software Update API if I ever decide to update this again
  • Add more protections like duplicate Dictionary Key Name Detection
  • Overrides that allow you to pass keys that are normally pruned from the dictionary
  • Custom name and input keys in case you need to use those for something else

Don'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 have JS and only touch it when I need to

Contributing

Contribute if you want, but no promises that I will merge it. I don't exactly expect to be active on this repo...