AEGetAttributeDesc
AEGetAttributeDesc Get descriptor record for an Apple Event attribute
#include <AppleEvents.h> Apple Event Manager
OSErr AEGetAttributeDesc ( theAppleEvent, AEKeyword, desiredType,
AppleEvent * theAppleEvent ; Apple event record
AEKeyword theAEkeyword ; Apple Event keyword
DescType desiredType ; Descriptor type
AEDesc * result ; Desired descriptor record
returns Error Code; 0 = no error
You can use the AEGetAttributeDesc function to get a descriptor record for
a specified Apple event attribute.
The AEGetAttributeDesc function returns the descriptor record for the
Apple event attribute with the specified keyword. Your application should call
the AEDisposeDesc function to dispose of the resulting descriptor record
after your application has finished using it.
The keyword can be one of the following:
Attribute keyword Description
keyAddressAttr Address of target application
keyEventClassAttr Event class of Apple event
keyEventIDAttr Event ID of Apple event
keyEventSourceAttr Source of the Apple event
keyInteractLevelAttr Settings for allowing the
Apple Event Manager to bring a server
application to the foreground
keyMissedKeywordAttr First required parameter remaining in an
Apple event.
keyOptionalKeywordAttr List of optional parameters for the Apple
event
keyReturnIDAttr Return ID for reply Apple event
keyTimeoutAttr Length of time in ticks that the client will
wait for a reply or a result from the server
keyTransactionIDAttr Transaction ID identifying a series of Apple
events
If AEGetAttributeDesc returns a nonzero result code, it returns a null
descriptor record (a descriptor record of type typeNull, which does not
contain any data) unless the Apple Event Manager is not available due to
limited memory.
The parameter theAppleEvent is the Apple event containing the desired
attribute.
The parameter theAEKeyword is the keyword that specifies the desired
attribute.
The desiredType parameter is the descriptor type of the descriptor record to
be returned; if the desired attribute is not of this type, the
Apple Event Manager attempts to coerce it into this type. If the value of
desiredType is typeWildCard, no coercion is performed, and the descriptor
type of the resulting descriptor record is the same as the descriptor type of
the attribute.
The AEGetAttributeDesc function returns in the result parameter the
resulting descriptor record. This function creates a new descriptor record by
copying the descriptor record from the parameter. Your application is
responsible for using the AEDisposeDesc function to dispose of the resulting
descriptor record once you are finished using it.
Result codes
noErr (0) No error
memFullErr (-108) Not enough room in heap zone
errAECoercionFail (-1700) Data could not be coerced to the descriptor type
errAEDescNotFound (-1701) Descriptor record was not found
errAENotAEDesc (-1704) Not a valid descriptor record
errAEReplyNotArrived (-1718) Reply has not yet arrived