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 Items From Descriptor Lists


AEGetNthDesc

You can use the AEGetNthDesc function to get a copy of a descriptor record from any descriptor list.

FUNCTION AEGetNthDesc (theAEDescList: AEDescList; index: LongInt; 
                       desiredType: DescType; 
                       VAR theAEKeyword: AEKeyword; 
                       VAR result: AEDesc): OSErr;
theAEDescList

The descriptor list containing the desired descriptor record.
index
The position of the desired descriptor record in the list (for example, 2 specifies the second descriptor record).
desiredType

The desired descriptor type for the copy of the descriptor record to be returned; if the desired 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 copied descriptor record is the same as the descriptor type of the original descriptor record.
theAEKeyword
The keyword of the specified descriptor record, if you are getting data from a list of keyword-specified descriptor records; otherwise, AEGetNthDesc returns the value typeWildCard.
result
A copy of the desired descriptor record coerced to the descriptor type specified by the desiredType parameter.
DESCRIPTION
The AEGetNthDesc function returns a specified descriptor record from a specified descriptor list.Your application should call the AEDisposeDesc function to dispose of the resulting descriptor record after your application has finished using it.

If AEGetNthDesc 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