Escape a string for use in AppleScript
npm install escape-string-applescript> Escape a string for use in AppleScript
According to the AppleScript docs, \ and " have special meaning and should be escaped.
```
$ npm install escape-string-applescript
`js
import {execFile} from 'child_process';
import escapeStringAppleScript from 'escape-string-applescript';
const string = escapeStringAppleScript('"i like unicorns"');
//=> '\"i like unicorns\"'
const script = set unicornMessage to "${string}";
execFile('osascript', ['-e', script]);
``
- run-applescript - Run AppleScript and get the result