Quit app when closing last window

Hi I think I have asked this before with no answer. But I see the option to make the red button "Quit App Under Cursor." But that quits the app even if I have 10 windows open. Is there some way (any way at all!) to have the red button close windows as usual if another window is open. But to quit the app when hitting the red button on the last window of an app.

So essentially, instead of an option to make the red button "Quit app under cursor" it would "Quit the app under cursor (only on the last window)."

Alternatively, can better touch tool auto-quit apps that are sitting in my dock without any windows open? Or any other app for that matter.

I have tried Quitter (only works for 10 apps) and I have tried RedQuits which mostly works but sometimes quits apps with multiple windows open. I was hoping BTT had some way to do this!

Thank you for any help!

1 Like

I wish I could say I have. Redquits is the only thing available right now and it hasn’t been updated in a long time. BTT almost has it. I just wish they’d modify it to only quit an app when closing the last window.

What other functions/options are available and attached to the red button or attached to whatever is under the cursor? I currently don't have BTT installed so can't check, and perhaps there's a way to achieve it that's not immediately obvious.

Not heard of either, but I'm assuming these run in the background and listen for messages sent by the system whenever an instance of a window is destroyed. That's something one can create themselves, in the form of a stay open AppleScript application. It would operate under the same principle (and not in a stupid that uses repeat loops or polling), by listening to system messages, so it would have to remain running. It's not going to be as efficient as an application written in Swift or Objective-C, but since loads of stuff now is written with JavaScript frameworks that rape your system for all their memory, it'll probably appear reasonably modest, save for any memory leaks which one has no control over with AppleScript (if this occurs, it means you'd need to restart the application whenever it becomes less responsive). It would also be hanging around on the dock, which might or might be annoying.

Yeah the only other options for the red button under "Window Interaction" is to minimize, zoom, fullscreen, etc.

As to RedQuits specifically, yeah I believe it does run in the background. It doesn't quit an app when you close a window, unless it's the last window of that app. It's just a little finicky and hasn't been updated in so long. So I thought it'd be nice if BTT implemented this functionality.

1 Like

Did you ever figure this out?

Unfortunately no.