14 Comments

Summary:

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.

applet_thumb

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

  1. Just download the precompiled Quit application we put together.
  2. 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

  1. Fire up the AppleScript Editor, which is located in /Applications/Utilities.
  2. 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
    
  3. Save it as an application and give it a name (may I suggest “Quit”?).
  4. 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

  1. Open up Automator (/Applications/Utilities) and choose to create a new service.
  2. Set Service receives to no input and leave everything else alone.
  3. 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:
  4. Save it and give it a name. I used Foo.
  5. Open up System Preferences and click on Keyboard (or Keyboard & Mouse, depending on your version of OS X).
  6. Go to the Keyboard Shortcuts tab and click on Application Shortcuts in the left pane.
  7. Click the + symbol to add a new shortcut and make sure the Application popup list is on All Applications.
  8. 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.
  9. 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:
  10. 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.

  1. You don’t need to do HALF of this – just select the “quit all applications” action in Automator and save it as a service.

    You don’t need to run a separate program – Apple has one built in!

    Please change the post because this really is SUCH A LONG WINDED way of doing it.

    Josh

    1. Thanks! I was not aware of that. I’ll update the post when I get a chance.

      1. Disregard that; it’s not going to be updated.

  2. Press and hold ⌘+Tab, tab-cycle through each app you want quit and press Q to quit. Sweet April Fools article…

    1. Still a pain.

  3. Freddy Krueger Thursday, April 1, 2010

    come on you silly people, if you want to quit all applications just hold the power button for 10 seconds

    1. love this way…
      lol

  4. Quit All Applications « Clark's Tech Blog Friday, April 2, 2010

    [...] at the Applescript Blog there’s a nice little post on how to quit all running applications. I thought I’d put up the python equivalent. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 [...]

  5. Is there a way to set this to close all except the application for current window?

    1. Josh Wolrich’s method will do that.

  6. Smite A. Hippie Sunday, April 4, 2010

    Umm you’ve heard of Command-Shift-Q right?

  7. Thanks Josh your right. I created an automator app to quit all open apps. It was easy and I put a check mark so I can save any of them if I want to.
    If you wanna quit all apps you can see how far you can throw the computer across the room ;-)

Comments have been disabled for this post