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

# AMAction

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

```
class AMAction
```

## 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`](/documentation/Automator/AMBundleAction) class, a subclass of [`AMAction`](/documentation/Automator/AMAction).

The critically important method declared by [`AMAction`](/documentation/Automator/AMAction) is [`run(withInput:)`](/documentation/Automator/AMAction/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`](/documentation/Automator/AMAction) is not recommended. For most situations requiring an enhancement to the Automator framework, it is sufficient to subclass [`AMBundleAction`](/documentation/Automator/AMBundleAction).

## Topics

### Initializing and Encoding

[`init(definition:fromArchive:)`](/documentation/Automator/AMAction/init(definition:fromArchive:))

Initializes the action with the specified definition.

[`init(contentsOf:)`](/documentation/Automator/AMAction/init(contentsOf:))

Loads an Automator action from a file URL.

[`write(to:)`](/documentation/Automator/AMAction/write(to:))

Examines the parameters and other configuration information specified in the passed dictionary and adds its own information to it if appropriate.

### Controlling the Action

[`run(withInput:)`](/documentation/Automator/AMAction/run(withInput:))

Requests the action to perform its task using the specified input.

[`runAsynchronously(withInput:)`](/documentation/Automator/AMAction/runAsynchronously(withInput:))

Causes Automator to wait for notification that the action has completed execution, which allows the action to perform an asynchronous operation.

[`finishRunningWithError(_:)`](/documentation/Automator/AMAction/finishRunningWithError(_:))

Causes the action to stop running and return an error, which, in turn, causes the workflow to stop.

[`willFinishRunning()`](/documentation/Automator/AMAction/willFinishRunning())

Provides an opportunity for an action to perform cleanup operations, such as closing windows and deallocating memory.

[`stop()`](/documentation/Automator/AMAction/stop())

Stops the action from running.

[`reset()`](/documentation/Automator/AMAction/reset())

Resets the action to its initial state.

### Initializing and Synchronizing the Action User Interface

[`activated()`](/documentation/Automator/AMAction/activated())

Allows the action to synchronize its information with settings in another app.

[`opened()`](/documentation/Automator/AMAction/opened())

Allows the action to initialize its user interface.

### Performing Logging

[`logMessageWithLevel:format:`](/documentation/Automator/AMAction/logMessageWithLevel:format:)

Displays a message in Automator’s log area.

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

Logging levels that Automator supports.

### Updating Action Parameters

[`parametersUpdated()`](/documentation/Automator/AMAction/parametersUpdated())

Requests the action to update its user interface from its stored parameters, which have changed.

[`updateParameters()`](/documentation/Automator/AMAction/updateParameters())

Requests the action to update its stored set of parameters from the settings in the action’s user interface.

### Getting Action Information

[`name`](/documentation/Automator/AMAction/name)

The name of the action.

[`progressValue`](/documentation/Automator/AMAction/progressValue)

A float value between 0 and 1, which indicates how far along the action is while processing.

[`ignoresInput`](/documentation/Automator/AMAction/ignoresInput)

A Boolean value that indicates whether the action acts upon its input or the input is ignored.

[`output`](/documentation/Automator/AMAction/output)

The action’s output.

[`selectedInputType`](/documentation/Automator/AMAction/selectedInputType)

The type of input, in UTI format, of the input received by the action.

[`selectedOutputType`](/documentation/Automator/AMAction/selectedOutputType)

The type of output, in UTI format, of the output to be produced by the action.

[`isStopped`](/documentation/Automator/AMAction/isStopped)

A Boolean value that indicates whether the user clicked the stop button on the parent workflow.

### Performing Cleanup Operations

[`closed()`](/documentation/Automator/AMAction/closed())

Invoked by Automator when the receiving action is removed from a workflow, allowing it to perform cleanup operations.

### Deprecated

[`runWithInput:fromAction:error:`](/documentation/Automator/AMAction/runWithInput:fromAction:error:)

Requests the action to perform its task using the specified input from the specified action.

[`didFinishRunningWithError:`](/documentation/Automator/AMAction/didFinishRunningWithError:)

Sent by the action to itself when it has finished running asynchronously.



---

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)