Script running when app is closed

Is it possible to run a script when app is closed?
I simply cand find any good extentions for that
I just want it to run when App is closed like Spotify or something like that

If you mean running in the background, take a look at this extension:

1 Like

What kind of script is that you like to run?
From your blocks we can see, that you like to send a notification each Monday at a given time
For this purpose you can use the alarmmanager extension