| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/Automator.framework |
| Availability | Available in Mac OS X v10.5 and later. |
| Declared in | AMWorkflowController.h |
| Companion guides | |
| Related sample code |
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.
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.
– canRun
– isRunning
– run:
– stop:
– workflowControllerWillRun: delegate method
– workflowControllerDidRun: delegate method
– workflowControllerWillStop: delegate method
– workflowControllerDidStop: delegate method
– workflowController:didRunAction: delegate method
– workflowController:willRunAction: delegate method
– workflowController:didError: delegate method
Returns a Boolean value that indicates whether the receiver's workflow is able to run.
- (BOOL)canRun
YES if the controller’s workflow is able to run; NO otherwise.
You might use this method to determine when to enable a “Run” button or other UI element you use to run the workflow.
AMWorkflowController.hReturns the receiver's delegate.
- (id)delegate
The controller’s delegate.
AMWorkflowController.hReturns a Boolean value that indicates whether the receiver's workflow is currently running.
- (BOOL)isRunning
YES if the controller’s workflow is currently running; NO otherwise.
AMWorkflowController.hRuns the associated workflow, after first clearing any results stored by its actions during any previous run.
- (IBAction)run:(id)sender
Object that initiated the run action.
AMWorkflowController.hSets the receiver's delegate.
- (void)setDelegate:(id)delegate
The delegate object to set. This object will receive updates on the progress and state of the workflow controller.
AMWorkflowController.hSets the receiver's workflow.
- (void)setWorkflow:(AMWorkflow *)workflow
A workflow object.
AMWorkflowController.hSets the receiver's workflow view.
- (void)setWorkflowView:(AMWorkflowView *)view
A workflow view object.
AMWorkflowController.hStops the associated workflow.
- (IBAction)stop:(id)sender
Object that initiated the stop action.
AMWorkflowController.hReturns the receiver's workflow.
- (AMWorkflow *)workflow
The controller’s workflow.
AMWorkflowController.hReturns the receiver's workflow view.
- (AMWorkflowView *)workflowView
The controller’s workflow view.
AMWorkflowController.hInvoked when the receiver's workflow encounters an error.
- (void)workflowController:(AMWorkflowController *)controller didError:(NSError *)error
The controller object sending the message.
If a workflow error occurs, upon return contains an instance of NSError that describes the problem.
AMWorkflowController.hInvoked when an action in the receiver's workflow is finished running.
- (void)workflowController:(AMWorkflowController *)controller didRunAction:(AMAction *)action
The controller object sending the message.
The workflow action that ran.
AMWorkflowController.hInvoked when an action in the receiver's workflow is about to run.
- (void)workflowController:(AMWorkflowController *)controller willRunAction:(AMAction *)action
The controller object sending the message.
The workflow action that will run.
AMWorkflowController.hInvoked after the workflow is run.
- (void)workflowControllerDidRun:(AMWorkflowController *)controller
The controller object sending the message.
AMWorkflowController.hInvoked after the workflow stops.
- (void)workflowControllerDidStop:(AMWorkflowController *)controller
The controller object sending the message.
AMWorkflowController.hInvoked when the workflow is about to run.
- (void)workflowControllerWillRun:(AMWorkflowController *)controller
The controller object sending the message.
AMWorkflowController.hInvoked when the workflow is about to stop.
- (void)workflowControllerWillStop:(AMWorkflowController *)controller
The controller object sending the message.
AMWorkflowController.hLast updated: 2007-07-09