---
title: "AESizeOfFlattenedDesc(_:)"
framework: coreservices
role: symbol
role_heading: Function
path: coreservices/1447305-aesizeofflatteneddesc
---

# AESizeOfFlattenedDesc(_:)

Returns the amount of buffer space needed to store the descriptor after flattening it.

## Declaration

```swift
func AESizeOfFlattenedDesc(_ theAEDesc: UnsafePointer<AEDesc>!) -> Size
```

## Parameters

- `theAEDesc`: A pointer to the descriptor to be flattened. See doc://com.apple.documentation/documentation/coreservices/aedesc.

## Return Value

Return Value The size, in bytes, required to store the flattened descriptor.

## Discussion

Discussion You call this function before calling AEFlattenDesc(_:_:_:_:) to determine the required size of the buffer for the flatten operation. Version-Notes Thread safe starting in OS X v10.2.

## See Also

### Serializing Apple Event Data

- [AEFlattenDesc(_:_:_:_:)](coreservices/1441808-aeflattendesc.md)
- [AEUnflattenDesc(_:_:)](coreservices/1448997-aeunflattendesc.md)
