Skip navigation.
 
mlRe: Terminating another application.
FROM : has
DATE : Fri Jan 18 19:32:00 2008

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

Related mailsAuthorDate
mlTerminating another application. Anoop Thomas Vargh… Jan 18, 17:43
mlRe: Terminating another application. Mike Abdullah Jan 18, 18:02
mlRe: Terminating another application. John Stiles Jan 18, 18:06
mlRe: Terminating another application. ? Jan 18, 18:08
mlRe: Terminating another application. has Jan 18, 19:32