Tip 323Make a “Quit All” App

Ever wanted to quit every single open application? Perhaps you want to free up memory for the launch of another app.

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. If no new file (Untitled) window is visible, click FileNew.

  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 ...

Get Mac Kung Fu, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.