---
title: "CreateRangeDescriptor(_:_:_:_:)"
framework: coreservices
role: symbol
role_heading: Function
path: coreservices/1444087-createrangedescriptor
---

# CreateRangeDescriptor(_:_:_:_:)

Creates a range descriptor that specifies a series of consecutive elements in the same container.

## Declaration

```swift
func CreateRangeDescriptor(_ rangeStart: UnsafeMutablePointer<AEDesc>!, _ rangeStop: UnsafeMutablePointer<AEDesc>!, _ disposeInputs: Bool, _ theDescriptor: UnsafeMutablePointer<AEDesc>!) -> OSErr
```

## Parameters

- `rangeStart`: A pointer to an object specifier that identifies the first Apple event object in the range. See doc://com.apple.documentation/documentation/coreservices/aedesc.
- `rangeStop`: A pointer to an object specifier that identifies the last Apple event object in the range. See doc://com.apple.documentation/documentation/coreservices/aedesc.
- `disposeInputs`: A Boolean value. Pass (TRUE) if the function should dispose of the descriptors for the rangeStart and rangeStop parameters and set them to the null descriptor or (FALSE) if your application will. A value of FALSE may be more efficient for some applications because it allows them to reuse descriptors.
- `theDescriptor`: A pointer to a descriptor. On successful return, the range descriptor created by CreateRangeDescriptor. Your application must dispose of this descriptor after it has finished using it. See doc://com.apple.documentation/documentation/coreservices/aedesc.

## Return Value

Return Value A result code. See Result Codes.

## Discussion

Discussion Although the rangeStart and rangeStop parameters can be any object specifiers—including object specifiers that specify more than one Apple event object—most applications expect these parameters to specify single Apple event objects.

## See Also

### Creating Object Specifiers

- [CreateCompDescriptor(_:_:_:_:_:)](coreservices/1449155-createcompdescriptor.md)
- [CreateLogicalDescriptor(_:_:_:_:)](coreservices/1445212-createlogicaldescriptor.md)
- [CreateObjSpecifier(_:_:_:_:_:_:)](coreservices/1450244-createobjspecifier.md)
- [CreateOffsetDescriptor(_:_:)](coreservices/1444957-createoffsetdescriptor.md)
