<!--
{
  "documentType" : "article",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/scripting-support",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Scripting Support"
}
-->

# Scripting Support

Allow users to control your app with AppleScript and other automation technologies, or run scripts from within your app.

## Topics

### Script Execution

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

An object that provides the ability to load, compile, and execute scripts.

### Apple Event Handling

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

A wrapper for the Apple event descriptor data type.

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

A mechanism for registering handler routines for specific types of Apple events and dispatching events to those handlers.

### Script Commands

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

A self-contained scripting statement.

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

A command that quits the specified app.

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

A command that sets one or more attributes or relationships to one or more values.

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

A command that moves one or more scriptable objects.

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

A command that creates a scriptable object.

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

A command that deletes a scriptable object.

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

A command that determines whether a scriptable object exists.

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

A command that retrieves a value or object from a scriptable object.

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

A command that clones one or more scriptable objects.

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

A command that counts the number of objects of a specified class in the specified object container.

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

A command that closes one or more scriptable objects.

### Object Specifiers

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

An abstract class used to represent natural language expressions.

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

A specifier for a simple attribute value, a one-to-one relationship, or all elements of a to-many relationship.

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

A specifier for an insertion point in a container relative to another object in the container.

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

A specifier for an arbitrary object in a collection or, if not a one-to-many relationship, the sole object.

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

A specifier for a range of objects in a container.

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

A specifier for an object in a collection (or container) by unique ID.

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

A specifier that indicates every object in a collection matching a condition.

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

A specifier for an object in a collection (or container) by name.

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

A specifier indicating the middle object in a collection or, if not a one-to-many relationship, the sole object.

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

A specifier representing an object in a collection (or container) with an index number.

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

A specifier that indicates an object in a collection by its position relative to another object.

### Script Dictionary Description

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

The top-level repository of scriptability information for an app at runtime.

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

A scriptable class that a macOS app supports.

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

An abstract class that provides the interface for querying the relationships and properties of a class.

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

A script command that a macOS app supports.

### Object Matching Tests

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

An abstract class that provides the basis for testing specifiers one at a time or in groups.

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

A comparison between an object specifier and a test object.

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

The logical combination of one or more specifier tests.

### NSObject Script Support

[NSComparisonMethods](/documentation/Foundation/nscomparisonmethods)

A collection of default comparison methods useful for performing specifier tests.

  <doc://com.apple.documentation/documentation/ObjectiveC/nsscriptingcomparisonmethods>

  <doc://com.apple.documentation/documentation/ObjectiveC/nsscriptkeyvaluecoding>

[NSScriptObjectSpecifiers](/documentation/Foundation/nsscriptobjectspecifiers)

A collection of methods providing additional object specifier functionality.

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

A mechanism for converting one kind of scripting data to another.

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

The context in which the current script command is executed.



---

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)