Winter 92 - MACINTOSH Q & A
MACINTOSH Q & A
MACINTOSH DEVLOPER TECH SUPPORT
Q If I send Apple events to myself and specify kAEQueueReply to AESend, the event doesn't get put in the queue as I requested. It shows up immediately in the reply
parameter. According to Inside Macintosh, if I specify kAEQueueReply I should treat
the reply event as undefined. Please help; my application falls apart because it never
receives the event it's supposed to. If this is a bug, will the behavior be changed in the
future?
A This isn't a bug; it's an undocumented "feature" of the Apple Event Manager (AEM). If you send an Apple event to yourself, the AEM directly dispatches to the handler
you've installed for that event. So Apple events you send to yourself don't come in
through WaitNextEvent. This means that if you reply to an Apple event you sent
yourself, your 'ansr' handler will get called directly.
This was not an arbitrary decision, though it can have some confusing ramifications
for an application. Two factors influenced the decision--the first minor, the second