---
title: "CreateObjSpecifier(_:_:_:_:_:_:)"
framework: coreservices
role: symbol
role_heading: Function
path: coreservices/1450244-createobjspecifier
---

# CreateObjSpecifier(_:_:_:_:_:_:)

Assembles an object specifier that identifies one or more Apple event objects, from other descriptors.

## Declaration

```swift
func CreateObjSpecifier(_ desiredClass: DescType, _ theContainer: UnsafeMutablePointer<AEDesc>!, _ keyForm: DescType, _ keyData: UnsafeMutablePointer<AEDesc>!, _ disposeInputs: Bool, _ objSpecifier: UnsafeMutablePointer<AEDesc>!) -> OSErr
```

## Parameters

- `desiredClass`: The object class of the desired Apple event objects. See doc://com.apple.documentation/documentation/coreservices/desctype.
- `theContainer`: A pointer to a descriptor that describes the container for the requested object, usually in the form of another object specifier. See doc://com.apple.documentation/documentation/coreservices/aedesc.
- `keyForm`: The key form for the object specifier.
- `keyData`: A pointer to a descriptor that supplies the key data for the object specifier.
- `disposeInputs`: A Boolean value. Pass (TRUE) if the function should dispose of the descriptors for the theContainer and keyData parameters or (FALSE) if your application will. A value of FALSE may be more efficient for some applications because it allows them to reuse descriptors.
- `objSpecifier`: On successful return, a pointer to the object specifier created by the CreateObjSpecifier function. If the function returns successfully, your application should call the doc://com.apple.documentation/documentation/coreservices/1444208-aedisposedesc function to dispose of this descriptor after it has finished using it.

## Return Value

Return Value A result code. See Result Codes.

## See Also

### Creating Object Specifiers

- [CreateCompDescriptor(_:_:_:_:_:)](coreservices/1449155-createcompdescriptor.md)
- [CreateLogicalDescriptor(_:_:_:_:)](coreservices/1445212-createlogicaldescriptor.md)
- [CreateOffsetDescriptor(_:_:)](coreservices/1444957-createoffsetdescriptor.md)
- [CreateRangeDescriptor(_:_:_:_:)](coreservices/1444087-createrangedescriptor.md)
