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

# AMShellScriptAction

An object that represents Automator actions whose runtime behavior is driven by a shell script or by a Perl or Python script.

```
class AMShellScriptAction
```

## Overview

When you create a Shell Script Automator Action project in Xcode, the project template supplies an [`AMShellScriptAction`](/documentation/Automator/AMShellScriptAction) instance as the Principal Class 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 [`AMShellScriptAction`](/documentation/Automator/AMShellScriptAction) for Principal Class if you need to.

## Topics

### Handling the I/O Separator Character

[`inputFieldSeparator`](/documentation/Automator/AMShellScriptAction/inputFieldSeparator)

A string to use as the delimiter between items in the string passed to the action through standard input.

[`outputFieldSeparator`](/documentation/Automator/AMShellScriptAction/outputFieldSeparator)

A string to use as a delimiter in the string output by the action.

[`remapLineEndings`](/documentation/Automator/AMShellScriptAction/remapLineEndings)

A Boolean value that indicates whether you want automatic remapping of carriage return (`\r`) to newline (`\n`) characters in the input string.

## Relationships

### Conforms To

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

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

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

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

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

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

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

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

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

### Inherits From

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

---

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)