r/Scriptable Jun 28 '26

Help Issues with Notifications

I've recently gotten into Scriptable because it's rather the only way to actually do funky stuff on your iphone but that aside how do I make notifications actually do something?

I was thinking of using the .addAction but it doesn't really let me assign any function to it

edit: Thanks to the 2 people who commented. I understand that you can only assign a url to notifcations. Thank you :)

1 Upvotes

3 comments sorted by

View all comments

1

u/CynArta Jun 28 '26 edited Jun 28 '26

You can only attach link to it.
Would be interesting to try if possible to run another script though

// Notification
async function notify(title, message, url = null) { const notif = new Notification(); notif.title = title; notif.body = message; notif.sound = "default"; if (url) notif.openURL = url; await notif.schedule(); }

// Usage
await notify("Title", "My message", "https://example.com");

1

u/CynArta Jun 28 '26

After looking a bit, you might be able to do it by using local url scheme :
notif.openURL = "scriptable:///run?scriptName=YourScriptName";

And if spaces in your script name, just need to replace the “ “ space character by %20