AEGetTheCurrentEvent
You can use theAEGetTheCurrentEvent
function to get the Apple event that is currently being handled.
FUNCTION AEGetTheCurrentEvent (VAR theAppleEvent: AppleEvent): OSErr;
theAppleEvent
- The Apple event that is currently being handled; if no Apple event is currently being handled,
AEGetTheCurrentEvent
returns a null descriptor record in this parameter.DESCRIPTION
In many applications, the handling of an Apple event involves one or more long chains of calls to internal routines. TheAEGetTheCurrentEvent
function makes it unnecessary for these calls to include the current Apple event as a parameter; the routines can simply callAEGetTheCurrentEvent
to get the current Apple event when it is needed.You can also use the
AEGetTheCurrentEvent
function to make sure that no Apple event is currently being handled. For example, suppose your application always uses an application-defined routine to delete a file. That routine can first callAEGetTheCurrentEvent
and delete the file only ifAEGetTheCurrentEvent
returns a null descriptor record (that is, only if no Apple event is currently being handled).RESULT CODE
noErr 0 No error