Contents

NSScriptClassDescription

A scriptable class that a macOS app supports.

Declaration

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. 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 in Cocoa Scripting Guide.

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

Getting a Script Class Description

Getting basic information about the script class

Getting and comparing Apple event codes

Getting attribute and relationship information

Getting command information

See Also

Script Dictionary Description