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 323 |
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 745 |
Signature | hs.task:interrupt() -> hs.task object |
---|---|
Type | Method |
Description |
Interrupts the task |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/task/libtask.m line 535 |
Signature | hs.task:isRunning() -> boolean |
---|---|
Type | Method |
Description |
Test if a task is still running. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/task/libtask.m line 683 |
Signature | hs.task:pause() -> boolean |
---|---|
Type | Method |
Description |
Pauses the task |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/task/libtask.m line 563 |
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 433 |
Signature | hs.task:resume() -> boolean |
---|---|
Type | Method |
Description |
Resumes the task |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/task/libtask.m line 596 |
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 254 |
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 770 |
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 278 |
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 351 |
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 401 |
Signature | hs.task:start() -> hs.task object | false |
---|---|
Type | Method |
Description |
Starts the task |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/task/libtask.m line 454 |
Signature | hs.task:terminate() -> hs.task object |
---|---|
Type | Method |
Description |
Terminates the task |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/task/libtask.m line 507 |
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 710 |
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 652 |
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 628 |
Signature | hs.task:workingDirectory() -> path |
---|---|
Type | Method |
Description |
Returns the working directory for the task. |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/task/libtask.m line 379 |
© 2014–2017 Hammerspoon contributors
Licensed under the MIT License.
https://www.hammerspoon.org/docs/hs.task.html