---
title: "AEGetAttributeDesc(_:_:_:_:)"
framework: coreservices
role: symbol
role_heading: Function
path: coreservices/1450314-aegetattributedesc
---

# AEGetAttributeDesc(_:_:_:_:)

Gets a copy of the descriptor for a specified Apple event attribute from an Apple event; typically used when your application needs to pass the descriptor on to another function.

## Declaration

```swift
func AEGetAttributeDesc(_ theAppleEvent: UnsafePointer<AppleEvent>!, _ theAEKeyword: AEKeyword, _ desiredType: DescType, _ result: UnsafeMutablePointer<AEDesc>!) -> OSErr
```

## Parameters

- `theAppleEvent`: A pointer to the Apple event to get the attribute descriptor from. See doc://com.apple.documentation/documentation/coreservices/appleevent.
- `theAEKeyword`: The keyword that specifies the desired attribute. 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.
- `result`: A pointer to a descriptor. On successful return, a copy of the specified Apple event attribute, coerced, if necessary, to the descriptor type specified in desiredType. On error, a null descriptor. If the function returns successfully, your application should call the doc://com.apple.documentation/documentation/coreservices/1444208-aedisposedesc function to dispose of the resulting descriptor after it has finished using it. See doc://com.apple.documentation/documentation/coreservices/aedesc.

## Return Value

Return Value A result code. See Result Codes.

## Discussion

Discussion To get Apple event attribute data for your application to use directly, call AEGetAttributePtr(_:_:_:_:_:_:_:). To get a descriptor for an Apple event attribute to pass on to another Apple Event Manager routine, call AEGetAttributeDesc.  Version-Notes Thread safe starting in OS X v10.2.

## See Also

### Getting Data or Descriptors From Apple Events and Apple Event Records

- [AEGetAttributePtr(_:_:_:_:_:_:_:)](coreservices/1445109-aegetattributeptr.md)
- [AEGetParamDesc(_:_:_:_:)](coreservices/1449233-aegetparamdesc.md)
- [AEGetParamPtr(_:_:_:_:_:_:_:)](coreservices/1444069-aegetparamptr.md)
