run-applescript
Version:
Run AppleScript and get the result
79 lines (43 loc) • 1.2 kB
Markdown
and get the result
```sh
npm install run-applescript
```
```js
import {runAppleScript} from 'run-applescript';
const result = await runAppleScript('return "unicorn"');
console.log(result);
//=> 'unicorn'
```
Returns a `Promise<string>` with the script result.
Type: `string`
The script to run.
Type: `object`
Type: `boolean`\
Default: `true`
Change the output style.
When `false`, returns the value in a [recompilable source form](https://ss64.com/osx/osascript.html).
Type: `AbortSignal`
An AbortSignal that can be used to cancel the AppleScript execution.
Returns a `string` with the script result.
Type: `string`
The script to run.
Type: `object`
Type: `boolean`\
Default: `true`
Change the output style.
When `false`, returns the value in a [recompilable source form](https://ss64.com/osx/osascript.html).
- [run-jxa](https://github.com/sindresorhus/run-jxa) - Run JXA code and get the result
> Run AppleScript