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 or Descriptor Records Out of Apple Event Parameters and Attributes


AEGetParamDesc

You can use the AEGetParamDesc function to get the descriptor record for a specified Apple event parameter.

FUNCTION AEGetParamDesc (theAppleEvent: AppleEvent; 
                         theAEKeyword: AEKeyword; 
                         desiredType: DescType; 
                         VAR result: AEDesc): OSErr;
theAppleEvent
The Apple event containing the desired parameter.
theAEKeyword

The keyword that specifies the desired parameter.
desiredType

The desired descriptor type for the descriptor record to be returned; if the requested Apple event parameter 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 data is the same as the descriptor type of the Apple event parameter.
result
The descriptor record from the desired Apple event parameter coerced to the descriptor type specified in desiredType.
DESCRIPTION
The AEGetParamDesc function returns, in the result parameter, the descriptor record for a specified Apple event parameter, which it attempts to coerce to the descriptor type specified by the desiredType parameter. Your application should call the AEDisposeDesc function to dispose of the resulting descriptor record after your application has finished using it.

If AEGetParamDesc returns a nonzero result code, it returns a null descriptor record unless the Apple Event Manager is not available because of limited memory.

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
SEE ALSO
For an example of the use of AEGetParamDesc, see "Getting Data Out of an Apple Event Parameter," which begins on page 4-26.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996