hammerspoon2-docs
    Preparing search index...

    Function create

    • Create a new task

      Parameters

      • launchPath: string

        The full path to the executable to run

      • arguments: string[]

        An array of arguments to pass to the executable

      • OptionalonTermination: ((exitCode: number, exitReason: string, error?: string) => void) | null

        Optional callback called when the task terminates with exit code and reason. If the program could not be started, exitReason is "launchFailed", exitCode is -1, and error describes why

      • Optionalenvironment: Record<string, string> | null

        Optional dictionary of environment variables for the task

      • OptionalonOutput: ((stream: string, data: string) => void) | null

        Optional callback called when the task produces output; stream is "stdout" or "stderr"

      Returns HSTask

      A task object. Call start() to begin execution.