Run Scriptable script from the Home Screen

I have a short script whose URL I know. I’d like to be able to run it by tapping on an icon on the Home Screen.

Is it possible to do this?

Fuller disclosure: As an exercise I wrote this script - to select which page set to open in Offline Pages Pro - as a replacement for a Shortcuts cut (which does the same thing). I actually don’t like Shortcuts appearing as the cut is run - and Scriptable presents the same problem.

(There is an underlying idea that I’m testing: Prototype in Shortcuts and then implement better in Scriptable.)

1 Like

Martin, see if this gives you what you need or at least gives you something that you can build on for your own particular requirements.

The same principle as for Shortcuts is used in that it will dynamically create a web page which you then bookmark to the home screen.

I’ve built in a little menu that allows you to just enter the name of your scriptable script or alternatively, specify a name and any custom URL you choose. You could extend this to cover whatever typical URL schemes you like (e.g. Pythonista, Drafts 5).

After getting those text based details, you then get prompted for an icon. I’ve added some example ones in as a standard set, and also an option to specify a URL for your own icon. The standard set can be modified however you wish, it is just a list of URLs.

Once the details are captured, it builds and loads a custom page in Safari, and then you can go from there for saving it to the home screen.

I’m positive you could do the same thing in Scriptable too, but I already had the basis for this in Shortcuts, so it seemed the most expedient way to give you an example approach.

Hope that helps.

4 Likes

Thanks! The idea of a data colon URL with a Base-64-encoded chunk of HTML is intriguing in its own right.