# escape-string-applescript

> Escape a string for use in AppleScript

Latest version **3.0.0** (published 2021-04-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install escape-string-applescript
pnpm add escape-string-applescript
yarn add escape-string-applescript
bun add escape-string-applescript
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2021-04-15 |
| First published | 2014-05-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=12 |
| Dependencies | 0 |
| Unpacked size | 2.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 14 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | escape, string, applescript, osascript, quote, quotes, backslash |

## Links

- npm: https://www.npmjs.com/package/escape-string-applescript
- Repository: https://github.com/sindresorhus/escape-string-applescript
- Homepage: https://github.com/sindresorhus/escape-string-applescript#readme
- Issues: https://github.com/sindresorhus/escape-string-applescript/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/escape-string-applescript

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 3.0.0 (latest) — 2021-04-15
- 2.0.0 — 2017-01-13
- 1.0.0 — 2014-08-06
- 0.1.1 — 2014-05-16
- 0.1.0 — 2014-05-14

## README

# escape-string-applescript

> Escape a string for use in AppleScript

According to the AppleScript [docs](https://developer.apple.com/library/mac/documentation/AppleScript/Conceptual/AppleScriptLangGuide/reference/ASLR_classes.html#//apple_ref/doc/uid/TP40000983-CH1g-DontLinkElementID_57), `\` and `"` have special meaning and should be escaped.

## Install

```
$ npm install escape-string-applescript
```

## Usage

```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]);
```

## Related

- [run-applescript](https://github.com/sindresorhus/run-applescript) - Run AppleScript and get the result

---
_Source: https://npm.io/package/escape-string-applescript · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
