Class

NSUserUnixTask

An object that executes unix applications.

Declaration

@interface NSUserUnixTask : NSUserScriptTask

Overview

The NSUserUnixTask class is intended to run unix applications, typically a shell script, from your application. It is intended to execute user-supplied scripts, 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 NSTask, NSAppleScript, or AMWorkflow classes. If the application is sandboxed, then the script must be in the NSApplicationScriptsDirectory folder. A sandboxed application may read from, but not write to, this folder.

If you simply need to execute unix 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, or the error stream of the script, use this class.

Topics

Executing the Unix Script

- executeWithArguments:completionHandler:

Execute the unix script with the specified arguments.

Standard Unix Streams

standardError

The standard error stream.

standardInput

The standard input stream.

standardOutput

The standard output stream.

Constants

NSUserUnixTaskCompletionHandler

Implement this block to retrieve an error from the Unix scripted executed by executeWithArguments:completionHandler:.

Relationships

Inherits From

See Also

Scripts and External Tasks

NSTask

An object representing a subprocess of the current process.

NSUserScriptTask

An object that executes scripts.

NSUserAppleScriptTask

An object that executes AppleScript scripts.

NSUserAutomatorTask

An object that executes Automator workflows.