Contents

runAsynchronously(withInput:)

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

Declaration

func runAsynchronously(withInput input: Any?)

Parameters

  • input:

    The input for the action. Should contain one or more objects compatible with one of the types specified in the action’s Selectedinputtype property.

Discussion

Override this method in actions that need to make asynchronous calls. After runAsynchronously(withInput:) is invoked, Automator doesn’t continue until the action invokes finishRunningWithError(_:). In your override of this method, you can make an asynchronous call, wait to be notified of its completion, then invoke finishRunningWithError(_:) to signal to Automator that the action has completed.

For actions that don’t need to make asynchronous calls, use runWithInput:fromAction:error: instead.

See Also

Controlling the Action