Skip to content

Instantly share code, notes, and snippets.

@markmunz
markmunz / NSAppleEventDescriptor+targetApplicationBundleID.m
Last active April 21, 2016 12:12
Avoiding the AESendMessage bug from 10.8.2 and, apparently, 10.9.0
+ (NSAppleEventDescriptor*)mm_appleEventWithEventClass:(AEEventClass)eventClass
eventID:(AEEventID)eventID
targetApplicationBundleID:(NSString*)bundleID
{
//NSAppleEventDescriptor *target = [NSAppleEventDescriptor descriptorWithDescriptorType:typeApplicationBundleID
// data:[bundleID dataUsingEncoding:NSUTF8StringEncoding]];
NSAppleEventDescriptor *target = [self mm_targetDescriptorForBundleID:bundleID];
return [NSAppleEventDescriptor appleEventWithEventClass:eventClass
eventID:eventID