My dad recently asked me how he could go about quitting every app at once. The easiest way, in my opinion, would be to ⌘-tab to bring up the app switcher, then (while still holding ⌘) hit q to quit the selected application, which will automatically cycle you through to the next application in the switcher. Rinse and repeat. Of course, you could just log out (⌘-option-q), but that’s a little extreme. So, I compiled this AppleScript from a couple other AppleScripts I had laying around. Hope it works for you, dad.
This AppleScript will kill most every running application, so long as it is not a background-only process. Hidden applications will also be killed. The applications are killed via their process id (PID), which is a little easier on the system than “telling” each one to quit. Some applications (iTunes and Interface Builder are the only ones I’ve run across) would not quit in this manner. I didn’t spend any time trying to figure out why, I just put a “try” block in to catch the errors, which are then added to a separate list to be quit via a “tell” block. In addition, there is an exclusion list, which contains only Finder. Problem applications could be added to the exclusion list to avoid quitting them with the “tell” block. If you would like to add applications to the exclusion_list list at the top of the script, surround the application name in quotes (“iTunes”) and separate application names with a comma {“iTunes”, “Interface Builder”} inside the brackets. Press ⌘-k to compile, and don’t forget to save (⌘-s).
A QUICK WORD OF CAUTION: This script kills the processes of running applications. Please make sure you have saved any and all open files before running this script. I will not be held accountable for any loss of work or productivity, or any other negative impact on your life that may result from using this script. By downloading and running this script, you release me from all liability.
Download the .scpt file and move it to your users Scripts folder (~/Library/Scripts). From there, you can run it by selecting it from the menu bar Script menu. See below for details on how to enable the Script Menu menu bar menu :)
Enable the Script Menu menu bar menu
There are two ways to enable the Script Menu menu bar item. The first and easiest is by running AppleScript Editor.app (Script Editor.app in Leopard), opening its Preferences window, and checking the box that reads “Show Script menu in menu bar”. Click here to open AppleScript Editor/Script Editor. Press ⌘-, (Command-comma) to open the Preferences window, or go to AppleScript Editor (Script Editor in Leopard) > Preferences from the menu bar.
The second way to enable the Script Menu item is to open it from the Menu Extras folder. Safari users, right-click the following link and select “Open link in a new tab”: Script Menu. Others will need to navigate to /System/Library/CoreServices/Menu Extras/, look for Script Menu.menu, and double-click it to open it in the menu bar. You can move menu bar items (as well as toolbar items) by holding the command key while clicking and dragging the icon. Position the Script Menu icon where you will have the easiest access to it.
Download “Kill-Running-Apps.scpt”