Sometimes, for whatever reason, you need to quit all your open applications. But going through each application and quitting them is a pain. Good thing Apple included a nifty little scripting language in OS X called AppleScript that will allow us to quit applications in one fell swoop.
The Easy Way
- Just download the precompiled Quit application we put together.
- You’re done, unless you want to assign it to a keyboard shortcut, in which case, read the Assigning a Keyboard Shortcut section below.
The Hard Way
- Fire up the AppleScript Editor, which is located in /Applications/Utilities.
- Copy this code and paste it into the AppleScript Editor window:
tell application "System Events" to set the visible of every process to true set white_list to {"Finder"} try tell application "Finder" set process_list to the name of every process whose visible is true end tell repeat with i from 1 to (number of items in process_list) set this_process to item i of the process_list if this_process is not in white_list then tell application this_process quit end tell end if end repeat on error tell the current application to display dialog "An error has occurred!" & return & "This script will now quit" buttons {"Quit"} default button 1 with icon 0 end try - Save it as an application and give it a name (may I suggest “Quit”?).
- That’s it. You can move it to your desktop so you can run it before you shut down, but that’s inefficient, isn’t it? Read on to find out how to assign it to a keyboard shortcut.
Assigning a Keyboard Shortcut
- Open up Automator (/Applications/Utilities) and choose to create a new service.
- Set Service receives to no input and leave everything else alone.
- Search for launch application in the search field on the left pane and drag the resulting action over to the right pane. Your Automator window should look like this:

- Save it and give it a name. I used Foo.
- Open up System Preferences and click on Keyboard (or Keyboard & Mouse, depending on your version of OS X).
- Go to the Keyboard Shortcuts tab and click on Application Shortcuts in the left pane.
- Click the + symbol to add a new shortcut and make sure the Application popup list is on All Applications.
- Put whatever name you gave the service you created earlier in the Menu Title field. It has to be the exact name, meaning capitalization matters.
- Click on the Keyboard Shortcut field and enter whatever shortcut you want. Shift-Command-Q is already taken by the system, so I used Option-Command-Q. Your window should look like this:

- Click Add, and you’re done.
Conclusion
Now you’re ready to take over the world. Well, maybe not, but you are ready to shut down.
{"source":"https:\/\/gigaom.com\/2010\/04\/01\/how-to-quit-all-open-applications-in-os-x\/wijax\/49e8740702c6da9341d50357217fb629","varname":"wijax_9dd0ea7fc10ca3cac32db2c225355cff","title_element":"header","title_class":"widget-title","title_before":"%3Cheader%20class%3D%22widget-title%22%3E","title_after":"%3C%2Fheader%3E"}