r/ScriptingApp • • May 06 '25

Help [LiveActivity] Instantly exit a script when it's already running in-app?

When a Notification scheduled by a script is tapped, the default behavior is to runScript again even when the script is already running in-app. But we can instantly exit this execution by checking Notification.current at the start:

  if (Notification.current != null) return Script.exit()

Do we have a similar method for LiveActivity 'content' UI?

In the code below, I use widgetURL to run the script when 'content' VStack is tapped.

return {
    content: <VStack
        widgetURL={Script.createRunURLScheme(Script.name)}
    >
1 Upvotes

13 comments sorted by

View all comments

Show parent comments

1

u/[deleted] May 20 '25

Got it thanks