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

# NSScriptClassDescription

A scriptable class that a macOS app supports.

```
class NSScriptClassDescription
```

## Overview

A scriptable application provides scriptability information that describes the commands and objects scripters can use in scripts that target the application. That includes information about the classes those scriptable objects are created from.

An application’s scriptability information is collected automatically by an instance of [`NSScriptSuiteRegistry`](/documentation/Foundation/NSScriptSuiteRegistry). The registry object creates an `NSScriptClassDescription` for each class it finds and caches these objects in memory. Cocoa scripting uses registry information in handling scripting requests that target the application.

A class description instance stores the name, attributes, relationships, and supported commands for a class. For example, a scriptable `document` class for a drawing application might support attributes such as `file` and `file type`, relationships such as collections of `circles`, `rectangles`, and `lines`, and commands such as `align` and `rotate`.

As with many of the classes in Cocoa’s built-in scripting support, your application may never need to directly work with instances of `NSScriptClassDescription`. However, one case where you might need access to a class description is if you override `objectSpecifier` in a scriptable class. For information on how to do this, see [Object Specifiers](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/ScriptableCocoaApplications/SApps_object_specifiers/SAppsObjectSpecifiers.html#//apple_ref/doc/uid/TP40002164-CH3) in [Cocoa Scripting Guide](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/ScriptableCocoaApplications/SApps_intro/SAppsIntro.html#//apple_ref/doc/uid/TP40002164).

Another case where your application may need access to class description information is if you override `indicesOfObjectsByEvaluatingWithContainer:count:` in a specifier class.

Although you can subclass `NSScriptClassDescription`, it is unlikely that you would need to do so, or even to create instances of it.

## Topics

### Initializing a Script Class Description

[`-  initWithSuiteName:className:dictionary:`](/documentation/Foundation/NSScriptClassDescription/init(suiteName:className:dictionary:))

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

### Getting a Script Class Description

[`+  classDescriptionForClass:`](/documentation/Foundation/NSScriptClassDescription/init(for:))

Returns the class description for the specified class or, if it is not scriptable, for the first superclass that is.

[`-  classDescriptionForKey:`](/documentation/Foundation/NSScriptClassDescription/forKey(_:))

Returns the class description instance for the class type of the specified attribute or relationship.

[`superclassDescription`](/documentation/Foundation/NSScriptClassDescription/superclass)

Returns the class description instance for the superclass of the receiver’s class.

### Getting basic information about the script class

[`className`](/documentation/Foundation/NSScriptClassDescription/className)

Returns the name of the class the receiver describes, as provided at initialization time.

[`defaultSubcontainerAttributeKey`](/documentation/Foundation/NSScriptClassDescription/defaultSubcontainerAttributeKey)

Returns the value of the `DefaultSubcontainerAttribute` entry of the class dictionary from which the receiver was instantiated.

[`implementationClassName`](/documentation/Foundation/NSScriptClassDescription/implementationClassName)

Returns the name of the Objective-C class instantiated to implement the scripting class.

[`-  isLocationRequiredToCreateForKey:`](/documentation/Foundation/NSScriptClassDescription/isLocationRequiredToCreate(forKey:))

Returns a Boolean value indicating whether an insertion location must be specified when creating a new object in the specified to-many relationship of the receiver.

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

Returns the name of the receiver’s suite.

### Getting and comparing Apple event codes

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

Returns the Apple event code associated with the receiver’s class.

[`-  appleEventCodeForKey:`](/documentation/Foundation/NSScriptClassDescription/appleEventCode(forKey:))

Returns the Apple event code for the specified attribute or relationship in the receiver.

[`-  matchesAppleEventCode:`](/documentation/Foundation/NSScriptClassDescription/matchesAppleEventCode(_:))

Returns a Boolean value indicating whether a primary or secondary Apple event code in the receiver matches the passed code.

### Getting attribute and relationship information

[`-  hasOrderedToManyRelationshipForKey:`](/documentation/Foundation/NSScriptClassDescription/hasOrderedToManyRelationship(forKey:))

Returns a Boolean value indicating whether the described class has an ordered to-many relationship identified by the specified key.

[`-  hasPropertyForKey:`](/documentation/Foundation/NSScriptClassDescription/hasProperty(forKey:))

Returns a Boolean value indicating whether the described class has a property identified by the specified key.

[`-  hasReadablePropertyForKey:`](/documentation/Foundation/NSScriptClassDescription/hasReadableProperty(forKey:))

Returns a Boolean value indicating whether the described class has a readable property identified by the specified key.

[`-  hasWritablePropertyForKey:`](/documentation/Foundation/NSScriptClassDescription/hasWritableProperty(forKey:))

Returns a Boolean value indicating whether the described class has a writable property identified by the specified key.

[`-  isReadOnlyKey:`](/documentation/Foundation/NSScriptClassDescription/isReadOnlyKey:)

Returns a Boolean value indicating whether a specified property in the receiver is read-only.

[`-  keyWithAppleEventCode:`](/documentation/Foundation/NSScriptClassDescription/key(withAppleEventCode:))

Given an Apple event code that identifies a property or element class, returns the key for the corresponding attribute, one-to-one relationship, or one-to-many relationship.

[`-  typeForKey:`](/documentation/Foundation/NSScriptClassDescription/type(forKey:))

Returns the name of the declared type of the attribute or relationship identified by the passed key.

### Getting command information

[`-  selectorForCommand:`](/documentation/Foundation/NSScriptClassDescription/selector(forCommand:))

Returns the selector associated with the receiver for the specified command description.

[`-  supportsCommand:`](/documentation/Foundation/NSScriptClassDescription/supportsCommand(_:))

Returns a Boolean value indicating whether the receiver or any superclass supports the specified command.

## Relationships

### Conforms To

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

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

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

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

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

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

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

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

### Inherits From

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

---

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)