Home » Questions » Computers [ Ask a new question ]

Getting Mac OS X applications to close after last window closed

Getting Mac OS X applications to close after last window closed

I know it's just a pet peeve, but I hate it that Mac OS X's Preview.app stays open when it has no windows open. Is there any way to make it close when its last window is closed?

Asked by: Guest | Views: 34
Total answers/comments: 3
Guest [Entry]

"Try RedQuits:

RedQuits is there to help if you have ever tried to close an
application with its red button and wondered why it is still open.
With RedQuits, all programs now quit when there's only one window left
for that program. If you want to quit and close all open windows of a
program, just uncheck ""Quit only when 1 window is left for that app.""
in the preferences."
Guest [Entry]

"I wrote an AppleScript application to do this for you.

In brief, it checks what applications are open, gives you the option to whitelist apps to be excluded from auto-quit, then every 60 seconds, quits all applications (that it can, due to limitations).

To alter the whitelist while it's running, click the icon in the dock for the selection dialog to reappear.

To quit, right click the Dock icon and choose ""Quit""

AppleScript source and Application: http://files.me.com/kioarthurdane/6kjl9k"
Guest [Entry]

"Override the following method in NSApplicationDelegate (which normally returns NO):

-(BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSapplication*)sender
{
return YES;
}"