AMAction is an abstract class that defines the interface and general characteristics of Automator actions. Automator is an Apple application 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.


@interface AMAction : NSObject


The critically important method declared by AMAction is runWithInput:error:. 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 Notes

Subclassing AMAction is not recommended. For most situations requiring an enhancement to the Automator framework, it is sufficient to subclass AMBundleAction.


Initialization and encoding

- initWithDefinition:fromArchive:

Initializes the receiver with the specified definition.

- initWithContentsOfURL:error:

Loads an Automator action from a file URL.

- writeToDictionary:

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

Controlling the action

- didFinishRunningWithError:

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

- finishRunningWithError:

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

- reset

Resets the receiver to its initial state.

- runAsynchronouslyWithInput:

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

- runWithInput:error:

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

- runWithInput:fromAction:error:

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

- stop

Stops the receiver from running.

- willFinishRunning

Invoked by Automator when the receiver has essentially completed its run phase.

Initializing and synchronizing the action user interface

- activated

Invoked when the window of the Automator workflow to which the receiver belongs becomes the main window. This allows the receiver to synchronize its information with settings in another application.

- opened

Invoked when the receiver is first added to a workflow, allowing it to initialize its user interface.

Performing logging

- logMessageWithLevel:format:

Displays a message in Automator’s log area. Note that this message is visible to the user.

Updating action parameters

- parametersUpdated

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

- updateParameters

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

Getting Information About the Action

- closed

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


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


The name of the action.


The action’s output.


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


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


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


Indicates whether the user clicked the stop button on the parent workflow.


Inherits From