Created
November 9, 2009 07:27
-
-
Save rentzsch/229760 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSAppleEventDescriptor *target = [NSAppleEventDescriptor descriptorWithDescriptorType:typeApplicationBundleID | |
data:[@"com.apple.Finder" dataUsingEncoding:NSUTF8StringEncoding]]; | |
NSAppleEventDescriptor *quitEvent = [NSAppleEventDescriptor appleEventWithEventClass:kCoreEventClass | |
eventID:kAEQuitApplication | |
targetDescriptor:target | |
returnID:kAutoGenerateReturnID | |
transactionID:kAnyTransactionID]; | |
OSStatus err = AESendMessage([quitEvent aeDesc], // theAppleEvent | |
NULL, // reply | |
kAENoReply, // sendMode | |
0); // sendPriority | |
NSAssert1( err == noErr, @"AESendMessage failed: %d", err ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment