Please allow application to quit when last window is closed

I just realized that this is a different thread than I expected.
I had my problems with this script too. So I developed a preset which got rid of most of the quirks (not all though).

Try to install the preset and see if it works better for you:

One example for the quirks are, that some settings windows from Menubar-Apps are never registered as frontmost and do not close with the red button. For example 'AlDente' in my case. So whenever I need to change anything in this app I have to deactivate/activate BTT.

1 Like

Another thing.
You can always open the Hovered/Focused UI Element Viewer to see what windows is registered as frontmost/hovered.
You get there by clicking on your trigger > Advanced Conditions (right panel) > Hovered/Focused UI Element Viewer.

Cheers

1 Like