hammerspoon2-docs
    Preparing search index...

    Function javascriptFromFile

    • Read a file from disk and execute its contents as OSA JavaScript. The file is read in the main process before being sent to the XPC helper. If the file cannot be read the promise resolves immediately with { success: false, result: null, raw: "Failed to read file: <path>" }.

      Parameters

      • path: string

        Absolute path to the OSA JavaScript source file.

      Returns Promise<any>

      A Promise resolving to { success, result, raw }.