---
title: "AESizeOfParam(_:_:_:_:)"
framework: coreservices
role: symbol
role_heading: Function
path: coreservices/1449998-aesizeofparam
---

# AESizeOfParam(_:_:_:_:)

Gets the size and descriptor type of an Apple event parameter from a descriptor of type AERecord or AppleEvent.

## Declaration

```swift
func AESizeOfParam(_ theAppleEvent: UnsafePointer<AppleEvent>!, _ theAEKeyword: AEKeyword, _ typeCode: UnsafeMutablePointer<DescType>!, _ dataSize: UnsafeMutablePointer<Size>!) -> OSErr
```

## Parameters

- `theAppleEvent`: A pointer to the Apple event to get the parameter data from. See doc://com.apple.documentation/documentation/coreservices/appleevent.
- `theAEKeyword`: The keyword that specifies the desired parameter. Some keyword parameter constants are described in doc://com.apple.documentation/documentation/coreservices/apple_events/1527206-keyword_parameter_constants. See doc://com.apple.documentation/documentation/coreservices/aekeyword.
- `typeCode`: A pointer to a descriptor type. On return, specifies the descriptor type of the 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. See doc://com.apple.documentation/documentation/coreservices/desctype.
- `dataSize`: A pointer to a size variable. On return, the length, in bytes, of the data in the Apple event parameter.

## Return Value

Return Value A result code. See Result Codes.

## Discussion

Discussion Thread safe starting in OS X v10.2.

## See Also

### Getting the Sizes and Descriptor Types of Descriptors

- [AESizeOfAttribute(_:_:_:_:)](coreservices/1445764-aesizeofattribute.md)
- [AESizeOfNthItem(_:_:_:_:)](coreservices/1447307-aesizeofnthitem.md)
