Class

AMWorkflowController

The AMWorkflowController class lets you manage an Automator workflow in your application. You use the AMWorkflow class to instantiate a workflow and an instance of AMWorkflowView to display it.

Declaration

@interface AMWorkflowController : NSController

Overview

A controller can run and stop a workflow and obtain information about its state. The controller’s delegate can receive messages as the workflow is executed and its actions are run.

You can load and run a workflow with minimal overhead by using the AMWorkflow class method runWorkflowAtURL:withInput:error:. When you use AMWorkflowController, you get more control of the process, but there’s more work, as you must create and initialize both the workflow and the workflow controller objects.

A workflow is run in a separate process so that any actions it contains are executed in a separate memory space. That helps to insulate your application from crashes, memory leaks, or exceptions that might occur from running the actions in a workflow.

Topics

Accessing the workflow

workflow

Returns the receiver's workflow.

Accessing the workflow view

workflowView

Returns the receiver's workflow view.

Accessing the delegate

delegate

Returns the receiver's delegate.

Controlling the workflow

- pause:

Pauses a workflow that is running.

- reset:

Stops a workflow, clears any action results, and resets the workflow back to an un-run state.

- run:

Runs the associated workflow, after first clearing any results stored by its actions during any previous run.

- step:

In a paused workflow, runs the next action in the workflow and then pauses again.

- stop:

Stops the associated workflow.

- workflowControllerWillRun:

Tells the delegate that the workflow controller object is about to run.

Deprecated
- workflowControllerDidRun:

Tells the delegate that the workflow controller object finished running.

Deprecated
- workflowControllerWillStop:

Tells the delegate that the workflow controller object is about to stop.

Deprecated
- workflowControllerDidStop:

Tells the delegate that the workflow controller object has stopped.

Deprecated

Getting workflow information

canRun

Returns a Boolean value that indicates whether the receiver's workflow is able to run.

paused

A Boolean value that indicates whether the receiver's workflow is currently paused.

running

A Boolean value that indicates whether the receiver's workflow is currently running.

Running an action in the workflow

- workflowController:didRunAction:

Invoked when an action in the receiver's workflow is finished running.

Deprecated
- workflowController:willRunAction:

Invoked when an action in the receiver's workflow is about to run.

Deprecated

Errors messages

- workflowController:didError:

Invoked when the receiver's workflow encounters an error.

Deprecated

Relationships

Inherits From