Re: Quitting all active applications
Re: Quitting all active applications
- Subject: Re: Quitting all active applications
- From: Marcus <email@hidden>
- Date: Thu, 28 Aug 2008 13:13:10 +0200
28 aug 2008 kl. 12.36 skrev Phil Faber:
Is there a simple way to quit all running applications?
Basically I want to achieve the same result as the first stage of
hitting 'shut down' (closing all applications) without actually
shutting down the system.
Take a look at the NSWorkspace class. The launchedApplications: method
will give you an array of running applications including their process
id. A simple solution would be to use NSTask to invoke the kill
command on each of them. Just remember to remove you application from
the array or it will be killed as well.
By the way, in what situation do you want to kill all running
applications?
Marcus
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden