Close All Windows in a Mac App with a Keystroke
Most Mac users know that hitting the Command+W keyboard shortcut will close the currently active window, but with a slight modification and by adding an additional key press, you can close all windows in just about any Mac OS X app or the Mac Finder.
What is this super excellent keyboard shortcut for closing everything?
It’s easy to remember, just add Option to the traditional close shortcut making it this: Command + Option + W
Command + Option + W will close ALL windows on a Mac
Hitting Command+Option+W will close all windows in the currently active Mac application, or the Finder of Mac OS X. If the window is open, it will close after hitting that keystroke combination.
Not into keyboard shortcuts? You can also access the “Close All Windows” option from File menu options in either the Finder or just about any Mac application, but it’s invisible by default until you hold down the “Option” key when choosing the File menu. This transforms “Close” into “Close All” as shown in this screen shot:
The short video below demonstrates this trick as well:
The windows close rapidly, if you want to quickly try this out yourself an easy place to start is in the Mac OS X Finder. Just open a bunch of new Finder windows (by hitting Command+N in modern versions of Mac OS X a bunch) and then hit Command+Option+W to close them all out. Or you can try it in another app by opening a bunch of documents in something like TextEdit or Preview and closing those all out together too. Close All is best used in applications when auto-save is left enabled, otherwise the window closing process will halt as a save dialog box is summoned and waiting for an action. If you happened to turn off auto-save in Mac OS X at some point, just turn it back on to get uninterrupted use out of this keystroke.
Note how this is very different from closing windows on quit, which closes all the windows when the application is quitting, thereby preventing the auto-restore function of Mac OS X from relaunching those windows. This trick closes the active windows, but does not quit the app or discard the windows from restore.
The Command+W keystroke for closing a single window has been around on the Mac since the earliest days of the operating system, and the Option modifier has been around for ages as well, but despite that, few Mac users seem to be aware of it. Learn this trick, you’ll surely use it often.
Enjoy this keystroke? There are even more, don’t forget to learn and master the 7 window management keyboard shortcuts for Mac
Just commenting to say it worked to close a bunch of finder windows all at once on my Mac. Thanks!
OSX super intuitive etc but I have to search online to find out how to close the 20 finder windows that Photoshop opened programmatically?
I think so not, anymore.
Too bad it doesn’t work for Thunderbird windows too.
This is a system level shortcut, Command+W closes windows everywhere in Mac OS X, it works with all applications.
Keep in mind, too, that, if multiple tabs are open in Safari, and, if Command-Option-W is pressed, the File menu option for this will say “Close Other Tabs,” and all of the Safari tabs that are open, except for the one that is currently active, will close.
@DCJ: Or option click a tab. As I’m researching a book, I do tend to acquire a LOT of open tabs!
I think you mean command (Apple)-click, option would have you saving those pages to your Downloads folder (useful as well)
One of the plus aspects in OS X is how consistent these key strokes are implemented. On other platforms I never really got into using them much cause every application, sometimes every release came with a different short cut for the same task. Only with the Mac I started to learn and use more than a handful commands.
It’s interesting how few people know about these key strokes. I started out on the Mac learning to use key strokes instead of always using the Mac. I was happy to see that key strokes for hiding and minimizing came over from NeXTStep.
The excellent Show Desktop lives in the menu bar; when clicked, all windows of all apps are hidden, not closed, taking the user to the Finder, with an option to open a Finder window, or not.
semi-related: hide every open window of *every app* by Option-Command-Clicking somewhere on the Desktop.
Two caveats: you have to be in some app before clicking on the Desktop (versus being in the Finder and trying it), and true, it doesn’t close the windows; just hides ’em.
Still, it’s a brilliant quick way to clear the decks.
surely command + q will also close ‘ALL’ windows too
No, They don’t close window they will quit the running application. But windows will be resumed again to same place as before.