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
| noErr | 0 | No error |
| memFullErr | -108 | Not enough room in heap zone |
| errAECoercionFail | -1700 | Data could not be coerced to the requested descriptor type |
| errAENotAEDesc | -1704 | Not a valid descriptor record |
SEE ALSO
For an example of the use of AEPutAttributeDesc, see Listing 5-1 on page 5-9.