escape-string-applescript
Escape a string for use in AppleScript
Last updated 10 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install escape-string-applescript 
SYNC missed versions from official npm registry.

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-applescript

Usage

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

Current Tags

  • 3.0.0                                ...           latest (6 years ago)

5 Versions

  • 3.0.0                                ...           6 years ago
  • 2.0.0                                ...           10 years ago
  • 1.0.0                                ...           12 years ago
  • 0.1.1                                ...           13 years ago
  • 0.1.0                                ...           13 years ago
Maintainers (1)
Downloads
Total 17
Today 0
This Week 0
This Month 8
Last Day 0
Last Week 4
Last Month 5
Dependencies (0)
None
Dev Dependencies (2)
Dependents (2)

© 2010 - cnpmjs.org x YWFE | Home | YWFE