JSPM

escape-string-applescript

0.1.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 255429
  • Score
    100M100P100Q195054F
  • License MIT

Escape a string for use in AppleScript

Package Exports

  • escape-string-applescript

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (escape-string-applescript) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

escape-string-applescript Build Status

Escape a string for use in AppleScript

According to the AppleScript docs \ and " have special meaning and should be escaped.

Install

$ npm install --save escape-string-applescript

Usage

var execFile = require('child_process').execFile;
var escapeString = require('escape-string-applescript');

var str = escapeString('"i like unicorns"');
//=> \"i like unicorns\"

var script = 'set unicornMessage to "' + str + '"';

execFile('osascript', ['-e', script]);

License

MIT © Sindre Sorhus