<!--
{
  "availability" : [
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSScriptCommandDescription",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSScriptCommandDescription"
  },
  "title" : "NSScriptCommandDescription"
}
-->

# NSScriptCommandDescription

A script command that a macOS app supports.

```
class NSScriptCommandDescription
```

## Overview

A scriptable application provides scriptability information that describes the commands and objects scripters can use in scripts that target the application. An application’s scripting information is collected automatically by an instance of [`NSScriptSuiteRegistry`](/documentation/Foundation/NSScriptSuiteRegistry), which creates an `NSScriptCommandDescription` for each command it finds, caches these objects in memory, and installs a command handler for each command.

A script command instance stores the name, class, argument types, and return type of a command. For example, commands in AppleScript’s Core suite include `clone`, `count`, `create`, `delete`, `exists`, and `move`.

The public methods of `NSScriptCommandDescription` are used primarily by Cocoa’s built-in scripting support in responding to Apple events that target the application. Although you can subclass the `NSScriptCommandDescription` class, it is unlikely that you would need to do so, or to create instances of it.

## Topics

### Initializing a Script Command Description

[`-  initWithSuiteName:commandName:dictionary:`](/documentation/Foundation/NSScriptCommandDescription/init(suiteName:commandName:dictionary:))

Initializes and returns a newly allocated instance of `NSScriptCommandDescription`.

### Getting Basic Information About the Command

[`appleEventClassCode`](/documentation/Foundation/NSScriptCommandDescription/appleEventClassCode)

Returns the four-character code for the Apple event class of the receiver’s command.

[`appleEventCode`](/documentation/Foundation/NSScriptCommandDescription/appleEventCode)

Returns the four-character code for the Apple event ID of the receiver’s command.

[`commandClassName`](/documentation/Foundation/NSScriptCommandDescription/commandClassName)

Returns the name of the class that will be instantiated to handle the command.

[`commandName`](/documentation/Foundation/NSScriptCommandDescription/commandName)

Returns the name of the command.

[`suiteName`](/documentation/Foundation/NSScriptCommandDescription/suiteName)

Returns the name of the suite that contains the command described by the receiver.

### Getting Command Argument Information

[`-  appleEventCodeForArgumentWithName:`](/documentation/Foundation/NSScriptCommandDescription/appleEventCodeForArgument(withName:))

Returns the Apple event code for the specified command argument of the receiver.

[`argumentNames`](/documentation/Foundation/NSScriptCommandDescription/argumentNames)

Returns the names (or keys) for all arguments of the receiver’s command.

[`-  isOptionalArgumentWithName:`](/documentation/Foundation/NSScriptCommandDescription/isOptionalArgument(withName:))

Returns a Boolean value that indicates whether the command argument identified by the specified argument key is an optional argument.

[`-  typeForArgumentWithName:`](/documentation/Foundation/NSScriptCommandDescription/typeForArgument(withName:))

Returns the type of the command argument identified by the specified key.

### Getting Command Return-Type Information

[`appleEventCodeForReturnType`](/documentation/Foundation/NSScriptCommandDescription/appleEventCodeForReturnType)

Returns the Apple event code that identifies the command’s return type.

[`returnType`](/documentation/Foundation/NSScriptCommandDescription/returnType)

Returns the return type of the command.

### Creating Commands

[`-  createCommandInstance`](/documentation/Foundation/NSScriptCommandDescription/createCommandInstance())

Creates and returns an instance of the command object described by the receiver.

[`-  createCommandInstanceWithZone:`](/documentation/Foundation/NSScriptCommandDescription/createCommandInstance(with:))

Creates and returns an instance of the command object described by the receiver in the specified memory zone.

## Relationships

### Conforms To

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Hashable`](/documentation/Swift/Hashable)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

[`CVarArg`](/documentation/Swift/CVarArg)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)