Error message

Hi. I have a script that works, but it also produces (invariably) this error:

/var/folders/wz/zpz3_3691ng0crd_3q8x983c0000gp/T/Keyboard-Maestro-Script-16ED00E6-3013-42B9-A738-0E992EDDCAF5:265:303: execution error: Error on line 12: Error: Invalid index. (-1719)

Is there something I can do to eliminate this / prevent it from occurring (I like what the script does)?


It would help if you post the script here.

Sorry, this is the right one:

Thanks. Could you please post a download link to the macro, so that we don’t have to re-type the whole script?

To export the macro: Select your macro in KM --> KM > File> Export Macros. Then drag the file into the edit window of a new post here.

Clear Notification Center.kmmacros (2.0 KB)

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.

So, in short, to get good answers here, it’s always a good idea to post…

  • What do I want to achieve
  • What I have done (+ downloadable macro + macro screenshot)
  • What is exactly the problem
  • System version, KM version, other infos

Posted at the same time.

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?

Good idea. Let me try and report back.

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.

Instead of doing the equivalent of:

  • For Each W in Windows
    • Close W

Do something more like:

  • While there are any Windows
    • Close the front window

Thanks Peter. Will try that.