Socket
Socket
Sign inDemoInstall

run-applescript

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

run-applescript - npm Package Compare versions

Comparing version 3.0.0 to 3.1.0

14

index.js
'use strict';
const execa = require('execa');
module.exports = str => {
module.exports = script => {
if (process.platform !== 'darwin') {
return Promise.reject(new Error('Only OS X is supported'));
return Promise.reject(new Error('macOS only'));
}
return execa.stdout('osascript', ['-e', str]);
return execa.stdout('osascript', ['-e', script]);
};
module.exports.sync = script => {
if (process.platform !== 'darwin') {
throw new Error('macOS only');
}
return execa.sync('osascript', ['-e', script]).stdout;
};
{
"name": "run-applescript",
"version": "3.0.0",
"version": "3.1.0",
"description": "Run AppleScript and get the result",

@@ -22,3 +22,3 @@ "license": "MIT",

"keywords": [
"osx",
"macos",
"mac",

@@ -31,3 +31,3 @@ "applescript",

"dependencies": {
"execa": "^0.4.0"
"execa": "^0.8.0"
},

@@ -37,6 +37,3 @@ "devDependencies": {

"xo": "*"
},
"xo": {
"esnext": true
}
}

@@ -9,3 +9,3 @@ # run-applescript [![Build Status](https://travis-ci.org/sindresorhus/run-applescript.svg?branch=master)](https://travis-ci.org/sindresorhus/run-applescript)

```
$ npm install --save run-applescript
$ npm install run-applescript
```

@@ -19,11 +19,29 @@

runApplescript('return "unicorn"').then(result => {
(async () => {
const result = await runApplescript('return "unicorn"');
console.log(result);
//=> 'unicorn'
});
})();
```
## API
### runAppleScript(script)
Returns a `Promise<string>` with the script result.
### runAppleScript.sync(script)
Returns a `string` with the script result.
## Related
- [run-jxa](https://github.com/sindresorhus/run-jxa) - Run JXA code and get the result
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc