---
title: "init(descriptor:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/nsscriptobjectspecifier/init(descriptor:)"
---

# init(descriptor:)

Returns a new object specifier for an Apple event descriptor.

## Declaration

```swift
init?(descriptor: NSAppleEventDescriptor)
```

## Parameters

- `descriptor`: An Apple event descriptor. The descriptor must have the type typeObjectSpecifier.

## Return Value

Return Value An object specifier, or nil if an error occurs.

## Discussion

Discussion If objectSpecifierWithDescriptor: is invoked and fails during the execution of a script command, information about the error that caused the failure is recorded in [NSScriptCommand currentCommand].

## See Also

### Related Documentation

- [Cocoa Scripting Guide](apple-archive/documentation/Cocoa/Conceptual/ScriptableCocoaApplications/SApps_intro/SAppsIntro.html.md)
