Well, I admit, I don’t get it. I’m dumb sometimes.
What do you want to achieve?
From the script, I assume you want something like:
If a notification from the App Store (Software update) pops up --> auto-confirm it
Is this correct?
Otherwise just tell us what you want to achieve. Sometimes there are better ways to achieve something, but for that we have to know what it is you want to achieve…
The script dismisses notifications and does it perfectly. It produces a log error on the screen each run, which then itself need to be dismissed! That’s all. Thx.
Without having digged further into the script (it needs MAS notifications to replicate): If it works fine, as you say, why don’t you just disable the “display results in a window” option?
The problem is likely that when you close one window, it is also closing another window. When you later try to close that latter window, you are getting the error.