How to reply to Apple Events
How to reply to Apple Events
- Subject: How to reply to Apple Events
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Tue, 16 Aug 2005 12:18:15 +0200
My app has a handler for events kCoreEventClass, kAEOpenDocuments (that
is aevt, odoc).
Sometimes (e.g. from Xcode) the replyEvent supplied to the handler
method is all nil (zero lenght data etc.)
In this case my handler works great.
But if the sender is an app which does:
string = "tell application "MyApp"
open POSIX file "/tmp/a" as alias
end tell"
[[[ NSAppleScript alloc ] initWithSource: string ]
executeAndReturnError: &errorInfo ]
MyApp gets a replyEvent of type aevt, ansr, and, if it does nothing
with this replyEvent, its event handler gets removed and replaced by
the default handler for odoc events. (So the next event opens the file
but does not pass through the event handler of MyApp).
So, what am I supposed to do with such a replyEvent?
Probably fill it out with something like: "ok" or "error with reason".
But how?
And then send it back. But how? I don't see anything for sending
replies in NSAppleEventManager.
Or: is there a way to send events which I don't know how to handle,
back to the default handler?
Kind regards,
Gerriet.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden