Re: Terminating another application.
Re: Terminating another application.
- Subject: Re: Terminating another application.
- From: has <email@hidden>
- Date: Fri, 18 Jan 2008 18:32:00 +0000
John Stiles wrote:
Or use AppleScript/AppleEvents, which have a built-in "quit" message
for
any regular app.
Example:
-(OSStatus)quitApplicationWithBundleID:(NSString *)bundleID {
OSStatus err;
AppleEvent event, reply;
const char *bundleIDString = [bundleID UTF8String];
err = AEBuildAppleEvent(kCoreEventClass, kAEQuitApplication,
typeApplicationBundleID,
bundleIDString, strlen(bundleIDString),
kAutoGenerateReturnID, kAnyTransactionID,
&event, NULL, "");
if (err) return err;
err = AESendMessage(&event, &reply, kAENoReply, kAEDefaultTimeout);
AEDisposeDesc(&event);
return err;
}
has
--
http://appscript.sourceforge.net
http://rb-appscript.rubyforge.org
_______________________________________________
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