Re: Quitting one application from within another
Re: Quitting one application from within another
- Subject: Re: Quitting one application from within another
- From: John Stiles <email@hidden>
- Date: Thu, 16 Dec 2004 08:43:08 -0800
On Dec 16, 2004, at 8:26 AM, j o a r wrote:
On 2004-12-16, at 17.15, Peter Browne wrote:
Hi, I'm wondering if it's possible to terminate an application from
within another. I know you can launch applications etc by using the
NSSharedWorkspace methods, but I haven't come across anything similar
for terminating that application when it's no-longer needed. Any
ideas?
There is no convenience functionality in Cocoa for doing that. You
could investigate sending a quit AppleEvent (see list archives for
more info), or if you need to force quit, use NSTask and "kill".
It's also quite possible there's something available to do this in
Carbon or some other library / framework that I don't know of.
Sending a quit AppleEvent would be the Carbon way (and AFAIK the only
way :) ). AEBuildAppleEvent is what you want.
The syntax can be pretty puzzling if you don't know AppleEvents; you
can ask George Warner (email@hidden) for details if you get stuck.
He knows AppleScript pretty darn well.
http://developer.apple.com/documentation/Carbon/Reference/
Apple_Event_Manager/index.html
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden