Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Interapplication Communication /
Chapter 4 - Responding to Apple Events / Reference to Responding to Apple Events
Routines for Responding to Apple Events / Getting Data and Keyword-Specified Descriptor Records Out of AE Records


AEGetKeyDesc

You can use the AEGetKeyDesc function to get the descriptor record for a keyword-specified descriptor record. You can use this function to get a descriptor record out of an AE record or an Apple event record.

FUNCTION AEGetKeyDesc (theAERecord: AERecord; 
                       theAEKeyword: AEKeyword; 
                       desiredType: DescType; 
                       VAR result: AEDesc): OSErr;
theAERecord

The AE record containing the desired descriptor record.
theAEKeyword
The keyword that specifies the desired descriptor record.
desiredType
The desired descriptor type for the descriptor record to be returned; if the requested descriptor record is not of this type, the Apple Event Manager attempts to coerce it to this type. If the value of desiredType is typeWildCard, no coercion is performed, and the descriptor type of the returned descriptor record is the same as the descriptor type of the original descriptor record.
result
A copy of the keyword-specified descriptor record, coerced to the descriptor type specified in the desiredType parameter.
DESCRIPTION
The AEGetKeyDesc function returns a copy of the descriptor record for a keyword-specified descriptor record. Your application should call the AEDisposeDesc function to dispose of the resulting descriptor record after your application has finished using it.

If AEGetKeyDesc returns a nonzero result code, it returns a descriptor record of descriptor type typeNull. A descriptor record of this type does not contain any data.

RESULT CODES
noErr0No error
memFullErr-108Not enough room in heap zone
errAECoercionFail-1700Data could not be coerced to the requested descriptor type
errAEDescNotFound-1701Descriptor record was not found
errAENotAEDesc-1704Not a valid descriptor record
errAEReplyNotArrived-1718Reply has not yet arrived

Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996