---
title: "AECountItems(_:_:)"
framework: coreservices
role: symbol
role_heading: Function
path: coreservices/1449533-aecountitems
---

# AECountItems(_:_:)

Counts the number of descriptors in a descriptor list.

## Declaration

```swift
func AECountItems(_ theAEDescList: UnsafePointer<AEDescList>!, _ theCount: UnsafeMutablePointer<Int>!) -> OSErr
```

## Parameters

- `theAEDescList`: A pointer to the descriptor list to count. See doc://com.apple.documentation/documentation/coreservices/aedesclist.
- `theCount`: A pointer to a count variable. On return, the number of descriptors in the specified descriptor list, which can be 0, if the list is empty.

## Return Value

Return Value A result code. See Result Codes.

## Discussion

Discussion Your application typically counts the descriptors in a descriptor list when it is extracting data from an Apple event. You can use the functions in “Getting Items From Descriptor Lists” to get an individual item from a descriptor list or to iterate through the items.  Version-Notes Thread safe starting in OS X v10.2.
