---
title: "AEDuplicateDesc(_:_:)"
framework: coreservices
role: symbol
role_heading: Function
path: coreservices/1442661-aeduplicatedesc
---

# AEDuplicateDesc(_:_:)

Creates a copy of a descriptor.

## Declaration

```swift
func AEDuplicateDesc(_ theAEDesc: UnsafePointer<AEDesc>!, _ result: UnsafeMutablePointer<AEDesc>!) -> OSErr
```

## Parameters

- `theAEDesc`: A pointer to the descriptor to duplicate. See doc://com.apple.documentation/documentation/coreservices/aedesc.
- `result`: A pointer to a descriptor. On return, the descriptor contains a copy of the descriptor specified by the theAEDesc parameter. 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 It is common for applications to send Apple events that have one or more attributes or parameters in common. For example, if you send a series of Apple events to the same application, the address attribute is the same. In these cases, the most efficient way to create the necessary Apple events is to make a template Apple event that you can then copy—by calling the AEDuplicateDesc function—as needed. You then fill in or change the remaining parameters and attributes of the copy, send the copy by calling the AESend(_:_:_:_:_:_:_:) function and, after AESend returns a result code, dispose of the copy by calling AEDisposeDesc(_:). You can use this approach to prepare structures of type AEDesc, AEDescList, AERecord, and AppleEvent.  Version-Notes Thread safe starting in OS X v10.2.

## See Also

### Creating and Duplicating Descriptors

- [AECreateDesc(_:_:_:_:)](coreservices/1448535-aecreatedesc.md)
- [AECreateDescFromExternalPtr(_:_:_:_:_:_:)](coreservices/1446239-aecreatedescfromexternalptr.md)
