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/libtask.m line 176 |
| Signature | hs.task:closeInput() -> hs.task object |
|---|---|
| Type | Method |
| Description | Closes the task's stdin |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/task/libtask.m line 337 |
| Signature | hs.task:environment() -> environment |
|---|---|
| Type | Method |
| Description | Returns the environment variables as a table for the task. |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/task/libtask.m line 759 |
| Signature | hs.task:interrupt() -> hs.task object |
|---|---|
| Type | Method |
| Description | Interrupts the task |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/task/libtask.m line 549 |
| Signature | hs.task:isRunning() -> boolean |
|---|---|
| Type | Method |
| Description | Test if a task is still running. |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/task/libtask.m line 697 |
| Signature | hs.task:pause() -> boolean |
|---|---|
| Type | Method |
| Description | Pauses the task |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/task/libtask.m line 577 |
| Signature | hs.task:pid() -> integer |
|---|---|
| Type | Method |
| Description | Gets the PID of a running/finished task |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/task/libtask.m line 447 |
| Signature | hs.task:resume() -> boolean |
|---|---|
| Type | Method |
| Description | Resumes the task |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/task/libtask.m line 610 |
| 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/libtask.m line 268 |
| Signature | hs.task:setEnvironment(environment) -> hs.task object | false |
|---|---|
| Type | Method |
| Description | Sets the environment variables for the task. |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/task/libtask.m line 784 |
| 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/libtask.m line 292 |
| 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/libtask.m line 365 |
| 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/libtask.m line 415 |
| Signature | hs.task:start() -> hs.task object | false |
|---|---|
| Type | Method |
| Description | Starts the task |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/task/libtask.m line 468 |
| Signature | hs.task:terminate() -> hs.task object |
|---|---|
| Type | Method |
| Description | Terminates the task |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/task/libtask.m line 521 |
| 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/libtask.m line 724 |
| 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/libtask.m line 666 |
| Signature | hs.task:waitUntilExit() -> hs.task object |
|---|---|
| Type | Method |
| Description | Blocks Hammerspoon until the task exits |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/task/libtask.m line 642 |
| Signature | hs.task:workingDirectory() -> path |
|---|---|
| Type | Method |
| Description | Returns the working directory for the task. |
| Parameters |
|
| Returns |
|
| Notes |
|
| Source | extensions/task/libtask.m line 393 |