I'm registering an Apple Event handler using NSAppleEventManager:
[[NSAppleEventManager sharedAppleEventManager]
setEventHandler:self andSelector:@selector(handleGetURLEvent:withReplyEvent:)
forEventClass:kInternetEventClass andEventID:kAEGetURL];
My handler method will, of course, receive the event and a reply event:
- (void) handleGetURLEvent:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent {
//Open this URL; reply if we can't
}
So, if I need to reply with an error, indicating that I failed in some way to open this URL, how should I use the replyEvent
to do that?
I have translated the following from the old-style C procedural API described in Apple's legacy document "Apple Events Programming Guide" to Cocoa:
See "Returning Error Information" in the "Apple Events Programming Guide" (in the Legacy library).