run-applescript

Run AppleScript and get the result

Usage no npm install needed!

<script type="module">
  import runApplescript from 'https://cdn.skypack.dev/run-applescript';
</script>

README

run-applescript

Run AppleScript and get the result

Install

$ npm install run-applescript

Usage

import {runAppleScript} from 'run-applescript';

const result = await runAppleScript('return "unicorn"');

console.log(result);
//=> 'unicorn'

API

runAppleScript(script)

Returns a Promise<string> with the script result.

runAppleScriptSync(script)

Returns a string with the script result.

Related

  • run-jxa - Run JXA code and get the result