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 5 - Creating and Sending Apple Events / Reference to Creating and Sending Apple Events
Routines for Creating and Sending Apple Events / Adding Parameters and Attributes to Apple Events


AEPutAttributeDesc

You can use the AEPutAttributeDesc function to add a descriptor record and a keyword to an Apple event as an attribute.

FUNCTION AEPutAttributeDesc (theAppleEvent: AppleEvent;
                             theAEKeyword: AEKeyword; 
                             theAEDesc: AEDesc): OSErr;
theAppleEvent
The Apple event to which you are adding an attribute.
theAEKeyword
The keyword for the attribute to be added.
TYPE AEKeyword = PACKED ARRAY[1..4] OF Char;
The keyword can be any of the constants listed in the description of AEPutAttributePtr on page 5-36. If the Apple event already included an attribute with this keyword, the attribute is replaced.
theAEDesc
The descriptor record to be assigned to the attribute. The descriptor type of the specified descriptor record should match the defined descriptor type for that attribute. For example, the keyEventSourceAttr attribute has the typeShortInteger descriptor type.
DESCRIPTION
The AEPutAttributeDesc function takes a descriptor record and a keyword and adds them to an Apple event as an attribute. If the descriptor type required for the attribute is different from the descriptor type of the descriptor record, the Apple Event Manager attempts to coerce the descriptor record into the required type, with one exception: the Apple Event Manager does not attempt to coerce the data for an address attribute, thereby allowing applications to use their own address types.

RESULT CODES
noErr0No error
memFullErr-108Not enough room in heap zone
errAECoercionFail-1700Data could not be coerced to the requested descriptor type
errAENotAEDesc-1704Not a valid descriptor record
SEE ALSO
For an example of the use of AEPutAttributeDesc, see Listing 5-1 on page 5-9.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996