@cjser/escape-string-applescript
v3.0.0-cjser.2
Published
Escape a string for use in AppleScript
Downloads
73
Maintainers
Readme
escape-string-applescript
Escape a string for use in AppleScript
According to the AppleScript docs, \ and " have special meaning and should be escaped.
Install
$ npm install escape-string-applescriptUsage
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]);Related
- run-applescript - Run AppleScript 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/escape-string-applescript
