Any way to isolate exactly why/where an action failed? [Manipulate Window could not find any matching windows]

This is the error from the log:
Action 16398095 failed: Manipulate Window could not find any matching windows

The function of this macro is to hide all windows, except for two (if either or both exist). Uusually it works as expected, but other times it will fail and hide one or both of the windows it shouldn't. At first, I thought the problem was to do with a known issue with VSCode where VSCode fails to hide or minimise in response to the hot keys. Indeed, this was a problem and what would happen was Keyboard Maestro would reach VSCode, fail to hide it, and then end there leaving VSCode in front having only hidden whatever came before. But I was able to (I think) solve this with the while loop. I haven't had any issues specifically with VSCode not being hidden since adding that action, but I don't know if maybe it could still be causing something weird to happen. Or maybe it's my regex again :melting_face: (though I don't think so because I don't think this error happens when VSCode isn't open...I will test more explicitly and report back).

Macro Image

Hide all app windows.kmmacros (18.1 KB)

Your macro contains a lot of UI manipulation. It could be that your macro is too fast. Use this statement at the top of your macro to check if that's the issue. (It will cause your macro to take 10 seconds to run.)

image

If this is the cause of your problem, (i.e., if this fixes your problem) we can then start searching for which action(s) are causing your issue.

Ahh, I hadn't even considered this. Just added that action and tested, and it seems to fix the issue of the one/other windows being hidden when they shouldn't. What's interesting, though, before that while I was testing with VSCode not running, the macro never hid a window it shouldn't, but the error still sometimes came up in the log. But I guess that makes sense since VSCode isn't the culprit in this case. I am still curious about what could be causing the error though since everything appears to be working on the surface.

I don't know. I don't have either of the apps you are using so it's hard to guess. Others might be able to help.