---
title: "AEGetParamDesc(_:_:_:_:)"
framework: coreservices
role: symbol
role_heading: Function
path: coreservices/1449233-aegetparamdesc
---

# AEGetParamDesc(_:_:_:_:)

Gets a copy of the descriptor for a keyword-specified Apple event parameter from an Apple event or an Apple event record.

## Declaration

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

## Parameters

- `theAppleEvent`: A pointer to the Apple event to get the parameter descriptor from.
- `theAEKeyword`: A keyword that specifies the desired Apple event parameter. Some keyword constants are described in doc://com.apple.documentation/documentation/coreservices/apple_events/1527206-keyword_parameter_constants.
- `desiredType`: The descriptor type for the desired Apple event parameter. For a list of AppleScript’s predefined descriptor types, see doc://com.apple.documentation/documentation/coreservices/apple_events/1542788-descriptor_type_constants. If the requested Apple event parameter is not of the desired type, the Apple Event Manager attempts to coerce it to the desired type. However, if you pass a value of typeWildCard, no coercion is performed, and the descriptor type of the returned descriptor is the same as the descriptor type of the Apple event parameter.
- `result`: A pointer to a descriptor. On successful return, a copy of the descriptor for the specified Apple event parameter, coerced, if necessary, to the descriptor type specified by the desiredType parameter. 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.

## Return Value

Return Value A result code. See Result Codes.

## Discussion

Discussion  You typically call AEGetParamDesc to get a descriptor for an Apple event parameter to pass on to another Apple Event Manager routine. To get Apple event parameter data for your application to use directly, call AEGetParamPtr(_:_:_:_:_:_:_:). If the actual parameter you are getting with AEGetParamDesc is a record, you can only request it as a typeAERecord, typeAEList, or typeWildcard. For any other type, AEGetParamDesc will return errAECoercionFail. Version-Notes Thread safe starting in OS X v10.2.

## See Also

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

- [AEGetAttributeDesc(_:_:_:_:)](coreservices/1450314-aegetattributedesc.md)
- [AEGetAttributePtr(_:_:_:_:_:_:_:)](coreservices/1445109-aegetattributeptr.md)
- [AEGetParamPtr(_:_:_:_:_:_:_:)](coreservices/1444069-aegetparamptr.md)
