@cjser/run-applescript
v7.1.0-cjser.2
Published
Run AppleScript and get the result
Maintainers
Readme
run-applescript
Run AppleScript and get the result
Install
npm install run-applescriptUsage
import {runAppleScript} from 'run-applescript';
const result = await runAppleScript('return "unicorn"');
console.log(result);
//=> 'unicorn'API
runAppleScript(script, options?)
Returns a Promise<string> with the script result.
script
Type: string
The script to run.
options
Type: object
humanReadableOutput
Type: boolean
Default: true
Change the output style.
When false, returns the value in a recompilable source form.
signal
Type: AbortSignal
An AbortSignal that can be used to cancel the AppleScript execution.
runAppleScriptSync(script, options?)
Returns a string with the script result.
script
Type: string
The script to run.
options
Type: object
humanReadableOutput
Type: boolean
Default: true
Change the output style.
When false, returns the value in a recompilable source form.
Related
- run-jxa - Run JXA code and get the result
cjser
This package is a CommonJS-compatible build generated by cjser for projects that still need require() support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.
Original repository: https://github.com/sindresorhus/run-applescript
