Execute processes in the background and capture their output
Notes:
Signature | hs.task.new(launchPath, callbackFn[, streamCallbackFn][, arguments]) -> hs.task object |
---|---|
Type | Function |
Description | Creates a new hs.task object |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/task/internal.m |
Signature | hs.task:closeInput() -> hs.task object |
---|---|
Type | Method |
Description | Closes the task's stdin |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/task/internal.m |
Signature | hs.task:environment() -> environment |
---|---|
Type | Method |
Description | Returns the environment variables as a table for the task. |
Parameters |
|
Returns |
|
Source | extensions/task/internal.m |
Signature | hs.task:interrupt() -> hs.task object |
---|---|
Type | Method |
Description | Interrupts the task |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/task/internal.m |
Signature | hs.task:isRunning() -> boolean |
---|---|
Type | Method |
Description | Test if a task is still running. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/task/internal.m |
Signature | hs.task:pause() -> boolean |
---|---|
Type | Method |
Description | Pauses the task |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/task/internal.m |
Signature | hs.task:pid() -> integer |
---|---|
Type | Method |
Description | Gets the PID of a running/finished task |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/task/internal.m |
Signature | hs.task:resume() -> boolean |
---|---|
Type | Method |
Description | Resumes the task |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/task/internal.m |
Signature | hs.task:setCallback(fn) -> hs.task object |
---|---|
Type | Method |
Description | Set or remove a callback function for a task. |
Parameters |
|
Returns |
|
Source | extensions/task/internal.m |
Signature | hs.task:setEnvironment(environment) -> hs.task object | false |
---|---|
Type | Method |
Description | Sets the environment variables for the task. |
Parameters |
|
Returns |
|
Source | extensions/task/internal.m |
Signature | hs.task:setInput(inputData) -> hs.task object |
---|---|
Type | Method |
Description | Sets the standard input data for a task |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/task/internal.m |
Signature | hs.task:setStreamingCallback(fn) -> hs.task object |
---|---|
Type | Method |
Description | Set a stream callback function for a task |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/task/internal.m |
Signature | hs.task:setWorkingDirectory(path) -> hs.task object | false |
---|---|
Type | Method |
Description | Sets the working directory for the task. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/task/internal.m |
Signature | hs.task:start() -> hs.task object | false |
---|---|
Type | Method |
Description | Starts the task |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/task/internal.m |
Signature | hs.task:terminate() -> hs.task object |
---|---|
Type | Method |
Description | Terminates the task |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/task/internal.m |
Signature | hs.task:terminationReason() -> exitCode | false |
---|---|
Type | Method |
Description | Returns the termination reason for a task, or false if the task is still running. |
Parameters |
|
Returns |
|
Source | extensions/task/internal.m |
Signature | hs.task:terminationStatus() -> exitCode | false |
---|---|
Type | Method |
Description | Returns the termination status of a task, or false if the task is still running. |
Parameters |
|
Returns |
|
Source | extensions/task/internal.m |
Signature | hs.task:waitUntilExit() -> hs.task object |
---|---|
Type | Method |
Description | Blocks Hammerspoon until the task exits |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/task/internal.m |
Signature | hs.task:workingDirectory() -> path |
---|---|
Type | Method |
Description | Returns the working directory for the task. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/task/internal.m |