---
title: "AESizeOfNthItem(_:_:_:_:)"
framework: coreservices
role: symbol
role_heading: Function
path: coreservices/1447307-aesizeofnthitem
---

# AESizeOfNthItem(_:_:_:_:)

Gets the data size and descriptor type of the descriptor at a specified position in a descriptor list.

## Declaration

```swift
func AESizeOfNthItem(_ theAEDescList: UnsafePointer<AEDescList>!, _ index: Int, _ typeCode: UnsafeMutablePointer<DescType>!, _ dataSize: UnsafeMutablePointer<Size>!) -> OSErr
```

## Parameters

- `theAEDescList`: A pointer to the descriptor list containing the descriptor. See doc://com.apple.documentation/documentation/coreservices/aedesclist.
- `index`: A one-based positive integer indicating the position of the descriptor to get the data size for. AESizeOfNthItem returns an error if you pass zero, a negative number, or a value that is out of range.
- `typeCode`: A pointer to a descriptor type. On return, specifies the descriptor type of the descriptor. 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 descriptor.

## 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)
- [AESizeOfParam(_:_:_:_:)](coreservices/1449998-aesizeofparam.md)
