User interaction when run with Siri

Hello everyone,

I got hooked into Scriptable automation for a few days now. In the past, I made some tools in Shortcuts, which I run from the homescreen and which provide basic user interaction like chosing an item form a list.
I would like to do the same thing with Scriptable as the possibilities of Shortcuts are often insufficient.

I wonder, if it was possible to ask for user input, when a Scriptable script is run with Siri, or from the homescreen.? Here is what I learned or tried so far:

• Alerts are not allowed in Siri
• The App tells “Scripts run with Siri can use the QuickLook API to present UI…”, but the documentation says, that the elements of a UITable “cannot be tapped when the tables is presented in Siri”
• I also tried presenting some HTML with a WebView, but when tapping it anywhere, it just opens up the Scriptable App

Is there any way to run a Scriptable script with Siri/Shortcuts from the homescreen and get input from the user?

Sadly, no. It seems that the whole UI you get to see in Siri and Shortcuts are only for displaying things, because as you’ve already found out Scriptable gets opened when tapping it. This is a system wide and there is nothing you or the developer of Scriptable can do.

A workaround could be to run the Scriptable parts in shortcuts and when user input is needed use the shortcuts actions.

You can run Scriptable scripts directly from the home screen though.

Thank you, schl3ck for the quick response. That is really a pity, as the Sortcuts actions like chose from list are quite tricky in some cases and mainly what I would like to improve by using JS code.

How exactly can I do that? When I click “Add to Home Screen” in Scriptable, it just opens a blank page in Safari.

Well, that is not what you should get. You should get something like this:

Maybe try a device reboot? Safari should be receiving the page as a data URI.

Got it. I just set up Brave as the default browser app, which could not handle the data URI. Using Safari as the default browser it works just fine, thank you.

It could look a little bit more elegant thow, if Scriptable’s home screen would not show up, before the script is started :slight_smile:

The reason it does that is that the home page shortcut is opening a Scriptable URL, which the Scriptable app handles.

For Simon to do anything different, Apple would need to provide something at the OS level that he could hook into somehow and run background execution.

That’s what Apple did for Shortcuts as this is exactly how Shortcuts used to operate before it became more deeply integrated into the OS.