Close all apps?

Discussion in 'Mac Basics and Help' started by kzlambert, Aug 12, 2006.

  1. kzlambert macrumors member

    kzlambert

    Joined:
    Aug 11, 2006
    Location:
    UK
    #1
    Hey Guys, I have always wondered if there was a quick way of closing all open aplications.. can anyone help?
     
  2. nickelbackmac macrumors regular

    nickelbackmac

    Joined:
    Jun 23, 2006
    Location:
    Jonesboro, Arkansas USA
    #2
    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...
     
  3. reh macrumors 6502a

    Joined:
    Oct 24, 2003
    Location:
    Arkansas
    #3
    Command-Shift-Option-Q will close all apps and log you out.
     
  4. kzlambert thread starter macrumors member

    kzlambert

    Joined:
    Aug 11, 2006
    Location:
    UK
    #4
    Thanks for that, ideally I would like to remain logged in though..
     
  5. reh macrumors 6502a

    Joined:
    Oct 24, 2003
    Location:
    Arkansas
    #5
    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.
     
  6. Mitthrawnuruodo Moderator emeritus

    Mitthrawnuruodo

    Joined:
    Mar 10, 2004
    Location:
    Bergen, Norway
    #6
    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... ;)
     
  7. kzlambert thread starter macrumors member

    kzlambert

    Joined:
    Aug 11, 2006
    Location:
    UK
    #7
    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 :)
     
  8. funkychunkz macrumors 6502a

    funkychunkz

    Joined:
    Jun 1, 2005
    Location:
    Ottawa, Canada
    #8
    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' .
     
  9. whocares macrumors 65816

    whocares

    Joined:
    Oct 9, 2002
    Location:
    :noitаɔo˩
    #9
    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:
     
  10. elbirth macrumors 65816

    Joined:
    Jan 19, 2006
    Location:
    North Carolina, US
    #10
    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?
     
  11. kzlambert thread starter macrumors member

    kzlambert

    Joined:
    Aug 11, 2006
    Location:
    UK
    #11
    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
     
  12. Mitthrawnuruodo Moderator emeritus

    Mitthrawnuruodo

    Joined:
    Mar 10, 2004
    Location:
    Bergen, Norway
    #12
    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...
     
  13. Applespider macrumors G4

    Applespider

    Joined:
    Jan 20, 2004
    Location:
    looking through rose-tinted spectacles...
    #13
    There's another thread here that talks about a script to close all non-hidden apps that are in the Dock

    EDIT: A Google brought up this thread from macosxhints which appears to allow you to exclude the Finder/Dock or anything else you want to but quits everything else.
     
  14. Mitthrawnuruodo Moderator emeritus

    Mitthrawnuruodo

    Joined:
    Mar 10, 2004
    Location:
    Bergen, Norway
    #14
    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:

    Now, the only thing might be to avoid that "hidden" restriction...
     
  15. Applespider macrumors G4

    Applespider

    Joined:
    Jan 20, 2004
    Location:
    looking through rose-tinted spectacles...
    #15
    I think the one from macosxhints manages to handle hidden ones too.
     
  16. Mitthrawnuruodo Moderator emeritus

    Mitthrawnuruodo

    Joined:
    Mar 10, 2004
    Location:
    Bergen, Norway
    #16
    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... ;)
     
  17. MacDonaldsd macrumors 65816

    MacDonaldsd

    Joined:
    Sep 8, 2005
    Location:
    London , UK
    #17
    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
     
  18. Mitthrawnuruodo Moderator emeritus

    Mitthrawnuruodo

    Joined:
    Mar 10, 2004
    Location:
    Bergen, Norway
    #18
    Wouldn't that tell application "Safari" make Safari to launch if it's not already running...?
     
  19. MacDonaldsd macrumors 65816

    MacDonaldsd

    Joined:
    Sep 8, 2005
    Location:
    London , UK
    #19
    Not sure because ive only played with apple script, but to my knowledge its

    tell application "Safari"
    activate
    end tell


    to launch Safari
     
  20. Mitthrawnuruodo Moderator emeritus

    Mitthrawnuruodo

    Joined:
    Mar 10, 2004
    Location:
    Bergen, Norway
    #20
    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... :)
     
  21. MacDonaldsd macrumors 65816

    MacDonaldsd

    Joined:
    Sep 8, 2005
    Location:
    London , UK
    #21
    :) I think your right. I never logout so it looked OK to me when I ran the script.
     
  22. Mitthrawnuruodo Moderator emeritus

    Mitthrawnuruodo

    Joined:
    Mar 10, 2004
    Location:
    Bergen, Norway
    #22
    You need something like:

    Code:
    if application "whatever" is not {} then
    	tell application "whatever"
    		quit
    	end tell
    end if
     
  23. Unorthodox macrumors 65816

    Unorthodox

    Joined:
    Mar 3, 2006
    Location:
    Not at the beach...
    #23
    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.
    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.
     

Share This Page