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

# AMAppleScriptAction

An object that represents Automator actions whose runtime behavior is driven by an AppleScript script.

```
class AMAppleScriptAction
```

## Overview

An [`AMAppleScriptAction`](/documentation/Automator/AMAppleScriptAction) object holds the compiled script as an instance of the `OSAScript` class. By default, the `OSAScript` object is instantiated from the script in the Xcode project file `main.applescript`.

When you create a Automator Applescript Action project in Xcode, the project template supplies an [`AMAppleScriptAction`](/documentation/Automator/AMAppleScriptAction) instance as File’s Owner of the action bundle. This ready-made instance provides a default implementation of the [`AMAction`](/documentation/Automator/AMAction) [`run(withInput:)`](/documentation/Automator/AMAction/run(withInput:)) method that uses the logic defined in the script. You can substitute your own subclass of [`AMAppleScriptAction`](/documentation/Automator/AMAppleScriptAction) for File’s Owner if you need to.

## Topics

### Accessing the script

[`script`](/documentation/Automator/AMAppleScriptAction/script)

An `OSAScript` object representing the receiver’s script containing the `on run` command handler.

## Relationships

### Inherits From

[`AMBundleAction`](/documentation/Automator/AMBundleAction)

### Conforms To

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

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

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

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

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

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

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

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

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

---

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)