• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Quitting one application from within another
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Quitting one application from within another (From: Peter Browne <email@hidden>)
 >Re: Quitting one application from within another (From: j o a r <email@hidden>)

  • Prev by Date: Re: Quitting one application from within another
  • Next by Date: Search Panel
  • Previous by thread: Re: Quitting one application from within another
  • Next by thread: Re: Quitting one application from within another
  • Index(es):
    • Date
    • Thread