Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

kzlambert

macrumors member
Original poster
Aug 11, 2006
50
0
UK
Hey Guys, I have always wondered if there was a quick way of closing all open aplications.. can anyone help?
 
I don't think so... of course, I've not had that much experience with Macs yet. If there ever was a way, I think it would be to highlight everything in Force Quit, then click Force Quit. But other than that, not that I know of...
 
Another quick way of closing a lot of apps is through the Command-Tab application switcher. You can hit Q while each app is highlighted to close it. It's not a single key-stroke, but it's still pretty quick.
 
Quickest way might be the cmd-tab-q-tab-q... "trick": Hit cmd-tab, then without letting go of the cmd key, hit q, then tab, then q, etc. until all but the Finder is quit. Then let go of the cmd key. :)

Edit: Just like reh said... ;)
 
reh said:
Another quick way of closing a lot of apps is through the Command-Tab application switcher. You can hit Q while each app is highlighted to close it. It's not a single key-stroke, but it's still pretty quick.

I agree that is a cool and very quick way to do it....if thats the closest to close all.....I would be reasonably happy :)
 
I remeber some sort of dock replacement app that let you quit all applications except the finder or other specified apps. If all your apps run out of a certain folder (like /Applications) then it would be fairly easy to kill all processes running outr of there with the terminal. Something involving 'grep', 'top' and 'kill' .
 
This should work (and then some):

In terminal:

Code:
killall -u username

This will kill all processes owned by username. I'm not quite sure exactly what it would do, but it should certainly quit all you apps. :p

Disclaimer: this is more of an FYI than a solution to your problem. :eek:
 
If you happened to be fairly observant during the WWDC keynote, one time when Steve got up from the computer after doing a demo of Spaces, he said "let me just go ahead and clean up these apps" and clicked an apple script icon in the dock on the far right-hand side that appeared to close all of the apps he had open (didn't just hide them, because the black triangles under the open apps went away). Later on at the beginning of the Core Animation demo, it looked like the mouse was still hovering over it and said "Close All"

So there's some way to at least do it via an apple script... anyone wanna poke around and find it out for sure?
 
elbirth said:
If you happened to be fairly observant during the WWDC keynote, one time when Steve got up from the computer after doing a demo of Spaces, he said "let me just go ahead and clean up these apps" and clicked an apple script icon in the dock on the far right-hand side that appeared to close all of the apps he had open (didn't just hide them, because the black triangles under the open apps went away). Later on at the beginning of the Core Animation demo, it looked like the mouse was still hovering over it and said "Close All"

So there's some way to at least do it via an apple script... anyone wanna poke around and find it out for sure?

Good spot, watching that was what made me begin this thread.. I thouht there must be a way.. unless its a new feature for Leopard
 
Well, it should be possible. The menu bar item Spirited Away, manages to keep track of all applications running in a list and then hides the ones having been idle for a certain amount of time. If anyone finds out how that list is compiled, it shouldn't be too hard to modify it and make a KillAll application...
 
I also found another thread from here at MR, Major Noob needs help with dock thing..., and - ironically - another one from MacOSXHints, Flagging Foreground Apps in UNIX/Applescript?. :)

Edit: But it seems Unorthodox' little script from the MR thread you found is the closest so far:

Unorthodox said:
This script will quit every open application that has a dock icon (except the Finder) and is NOT hidden.
Code:
tell application "Finder"
set dock_app to the name of every process whose visible is true
end tell

repeat with num from 1 to number of items in the dock_app
set this_app to item num of the dock_app
if this_app is not "Finder" then
tell application this_app
quit
end tell
end if
end repeat
So if you hide your apps a lot this script isn't for you.

Now, the only thing might be to avoid that "hidden" restriction...
 
Yes, but I like the simplicity of the other one... :eek:

Also, I want only to take out whatever is in my Dock. I suspect the MacOSXHints one will take out all my little menu bar items, too... unless I put them on the exclude-list, but I find the exclude-list kind of counter-productive: I feel I just as well could just make a simple KillAllThese script, which runs through a list of the names of (common) Applications and kills the ones running...

So, what I really want is a way, either in AppleScript or bash, to get a list of the Applications running in the Dock at any given time... that could be useful... ;)
 
You could do an apple script along these lines,

tell application "Safari"
quit
end tell
tell application "Mail"
quit
end tell
tell application "iTunes"
quit
end tell

You would have to list all the applications you wish to quit in the above way
 
Not sure because ive only played with apple script, but to my knowledge its

tell application "Safari"
activate
end tell


to launch Safari
 
He-he... that's how it's supposed to be. But if the application hasn't been launched yet (presumably since last login) it will start up when you run the tell application. Then once it has been quit it will ignore the telling... :)
 
Mitthrawnuruodo said:
He-he... that's how it's supposed to be. But if the application hasn't been launched yet (presumably since last login) it will start up when you run the tell application. Then once it has been quit it will ignore the telling... :)

:) I think your right. I never logout so it looked OK to me when I ran the script.
 
Mitthrawnuruodo said:
Edit: But it seems Unorthodox' little script from the MR thread you found is the closest so far:

Now, the only thing might be to avoid that "hidden" restriction...
Since all of those little menubar apps (or any other little apps that sit in the background) are all hidden, quitting only the visible apps was the only thing I could think of.

Well, the only EASY way.
You could add an if statment that excludes any specified app/s.
Like what what I did with the Finder.
But that would require manually listing every little hidden app.
As long as you don't frequently add new apps, that should work fine.

The script Applespider mentioned should do the trick!

All you have to do is modify the first line with whatever apps you don't want to quit.
property noQuitList : {"Dock", "SystemUIServer", "loginwindow", "System Events", "Finder"}

You can use Activity Monitor to see what is running on your system. Then add the ones you don't want to quit to the list.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.