---
title: "AEPutAttributeDesc(_:_:_:)"
framework: coreservices
role: symbol
role_heading: Function
path: coreservices/1441790-aeputattributedesc
---

# AEPutAttributeDesc(_:_:_:)

Adds a descriptor and a keyword to an Apple event as an attribute.

## Declaration

```swift
func AEPutAttributeDesc(_ theAppleEvent: UnsafeMutablePointer<AppleEvent>!, _ theAEKeyword: AEKeyword, _ theAEDesc: UnsafePointer<AEDesc>!) -> OSErr
```

## Parameters

- `theAppleEvent`: A pointer to the Apple event to add an attribute to. See the doc://com.apple.documentation/documentation/coreservices/appleevent data type.
- `theAEKeyword`: The keyword for the attribute to add. If the Apple event already includes an attribute with this keyword, the attribute is replaced. Some keyword constants are described in doc://com.apple.documentation/documentation/coreservices/apple_events/1542920-keyword_attribute_constants. See doc://com.apple.documentation/documentation/coreservices/aekeyword.
- `theAEDesc`: A pointer to the descriptor to assign to the attribute. The descriptor type of the specified descriptor should match the defined descriptor type for that attribute. See doc://com.apple.documentation/documentation/coreservices/aedesc.

## Return Value

Return Value A result code. See Result Codes.

## Discussion

Discussion The AEPutAttributeDesc function takes a descriptor 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, the Apple Event Manager attempts to coerce the descriptor 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.  Version-Notes Thread safe starting in OS X v10.2.

## See Also

### Adding Parameters and Attributes to Apple Events and Apple Event Records

- [AEPutAttributePtr(_:_:_:_:_:)](coreservices/1445940-aeputattributeptr.md)
- [AEPutParamDesc(_:_:_:)](coreservices/1447576-aeputparamdesc.md)
- [AEPutParamPtr(_:_:_:_:_:)](coreservices/1449263-aeputparamptr.md)
