Normally, if you want to close all open applications on your Mac, you will have to close them one by one or restart, shut down or close the session while making sure to deselect "Reopen windows when you log on again." This last option is great, but it doesn't always work on Mac OS X, and if you don't want to restart, shut down or close the session?
Now, with Automator, you can create an application in just a few seconds that can be placed in your dock and click once to turn off all other open applications in just a few seconds.
Step 1: Open Automator
Open Automator from your Applications folder or through Spotlight, then select "Application" and click on "Choose" to begin.
Step 2: Choose Applications to Close and Keep Open
Through the list of actions shown in the central window, search for ?Exit all applications? and double click on it to create a window on the right side of Automator.
Put a check next to "Ask to save changes" if you want certain applications with unsaved data to ask you to save the changes before they close. If not, keep it unchecked.
If you want some applications to remain open while all others are closed, go to the "Do not exit" list. Click on "Add …" and select the application from your library.
Step 3: Gurdelo as "Quit" (or another name)
When finished, go to "File" -> "Save", name your application "Quit" (or whatever you think appropriate), then click "Save."
Step 4: Quit All Open Apps in One Click
Find the Quit application in Finder and place it on your desk or in your dock. Choose to place it at the right end of the dock, next to other utilities that I use regularly.
Now, when you are ready to close all your open applications, simply click on the Exit icon once and they will begin to close. If there is an application on the "Do not exit" list, stay open in the Dock. And if the "Request changes" option is checked, receive a pop-up window for any unsaved material.