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 OS X app or the Mac Finder. What’s 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
Hitting Command+Option+W will close all windows in the currently active Mac application, or the Finder of OS X.
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 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 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 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