---
title: NSUserAutomatorTask
framework: foundation
role: symbol
role_heading: Class
path: foundation/nsuserautomatortask
---

# NSUserAutomatorTask

An object that executes Automator workflows.

## Declaration

```swift
class NSUserAutomatorTask
```

## Overview

Overview The NSUserAutomatorTask class is intended to run Automator workflows from your application. It is intended to execute user-supplied workflows, and will execute them outside of the application’s sandbox, if any. The class is not intended to execute scripts built into an application; for that, use one of the Process or AMWorkflow classes.  If the application is sandboxed, then the script must be in the FileManager.SearchPathDirectory.applicationScriptsDirectory folder.  A sandboxed application may read from, but not write to, this folder. If you simply need to execute scripts without regard to input or output, use NSUserScriptTask, which can execute any of the specific types.  If you need specific control over the input to or output from the workflow, use this class.

## Topics

### Executing Automator Tasks

- [execute(withInput:completionHandler:)](foundation/nsuserautomatortask/execute(withinput:completionhandler:).md)
- [variables](foundation/nsuserautomatortask/variables.md)

### Constants

- [NSUserAutomatorTask.CompletionHandler](foundation/nsuserautomatortask/completionhandler.md)

## Relationships

### Inherits From

- [NSUserScriptTask](foundation/nsuserscripttask.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Scripts and External Tasks

- [Process](foundation/process.md)
- [NSUserScriptTask](foundation/nsuserscripttask.md)
- [NSUserAppleScriptTask](foundation/nsuserapplescripttask.md)
- [NSUserUnixTask](foundation/nsuserunixtask.md)
