0
votes

Is there a way to force quit all other applications from a cocoa app? If it kills the app itself if doesn't matter It supposed to quit too.

It has to be force quit since i dont want any dialogue boxes about saving or anything poping up.

Thanks! and cocoa as in desktop osx. NOT iPhone.

1
Why on earth could you want to do this?Karl
I'm with Karl, I hesitate to answer because it's hard to think of a non-nefarious reason to do it.JWWalker
Agree with Karl. This is a SUPREMELY bad idea.Dave DeLong
I'd like to know why too, before I answer the question.JeremyP
I tought someone would like to know should have put it in the OP.. I'm making a worlplace panic button (its a little jokey app) Basically its a HUGE red button that when your goofing off at work (playing game or watching movies) and your boss walks by your press it and closes all the app and even opens a decoy spreadsheet. It need to force quit because it you had to press dont save or whatever your boss could see it. Besides a virus that closes apps sounds pretty lame. If you still think it for something evil I can send you the source code if you really want to make sure.user377419

1 Answers

1
votes

Look at the NSWorkspace method runningApplications and the class NSRunningApplication.