---
title: AMAction
framework: automator
role: symbol
role_heading: Class
path: automator/amaction
---

# AMAction

An abstract class that defines the interface and general characteristics of Automator actions.

## Declaration

```swift
class AMAction
```

## Overview

Overview Automator is an Apple app that allows users to construct and execute workflows consisting of a sequence of discrete modules called actions. An action performs a specific task, such as copying a file or cropping an image, and passes its output to Automator to give to the next action in the workflow. Actions are currently implemented as loadable bundles owned by objects of the AMBundleAction class, a subclass of AMAction. The critically important method declared by AMAction is run(withInput:). When Automator executes a workflow, it sends this message to each action object in the workflow (in workflow sequence), in most cases passing in the output of the previous action as input. The action object performs its task in this method and ends by returning an output object for the next action in the workflow. Subclassing AMAction is not recommended. For most situations requiring an enhancement to the Automator framework, it is sufficient to subclass AMBundleAction.

## Topics

### Initializing and Encoding

- [init(definition:fromArchive:)](automator/amaction/init(definition:fromarchive:).md)
- [init(contentsOf:)](automator/amaction/init(contentsof:).md)
- [write(to:)](automator/amaction/write(to:).md)

### Controlling the Action

- [run(withInput:)](automator/amaction/run(withinput:).md)
- [runAsynchronously(withInput:)](automator/amaction/runasynchronously(withinput:).md)
- [finishRunningWithError(_:)](automator/amaction/finishrunningwitherror(_:).md)
- [willFinishRunning()](automator/amaction/willfinishrunning().md)
- [stop()](automator/amaction/stop().md)
- [reset()](automator/amaction/reset().md)

### Initializing and Synchronizing the Action User Interface

- [activated()](automator/amaction/activated().md)
- [opened()](automator/amaction/opened().md)

### Performing Logging

- [AMLogLevel](automator/amloglevel.md)

### Updating Action Parameters

- [parametersUpdated()](automator/amaction/parametersupdated().md)
- [updateParameters()](automator/amaction/updateparameters().md)

### Getting Action Information

- [name](automator/amaction/name.md)
- [progressValue](automator/amaction/progressvalue.md)
- [ignoresInput](automator/amaction/ignoresinput.md)
- [output](automator/amaction/output.md)
- [selectedInputType](automator/amaction/selectedinputtype.md)
- [selectedOutputType](automator/amaction/selectedoutputtype.md)
- [isStopped](automator/amaction/isstopped.md)

### Performing Cleanup Operations

- [closed()](automator/amaction/closed().md)

### Initializers

- [init(contentsOfURL:)](automator/amaction/init(contentsofurl:).md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Inherited By

- [AMBundleAction](automator/ambundleaction.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Actions

- [AMBundleAction](automator/ambundleaction.md)
- [AMShellScriptAction](automator/amshellscriptaction.md)
