Execute Applescript through Node via Promises
npm install osascript-promise
Execute Applescript from Node via Promises. A wrapper around node-osascript by @fweinb. Pairs well with tj/co.
``javascript
var osascript = require('osascript-promise')
osascript('tell application "Google Chrome" to get URL of active tab of first window')
.then(function (result) {
console.log(result)
})
`
Works using any-promise, so native promises, bluebird, rsvp, when, and q are all supported without any changes to your code.

This promisifies the execute method from node-osascript.
#### osascript(command[, variables])
Pass your Applescript in via the command variable. Multiline scripts work well using the ES6 template string syntax:
`javascript
osascript(
tell application "Safari"
activate
open location "http://example.com"
end tell).then(() => console.log('Success!'))`
Applescript variables can be passed to the script as an object in the second argument:
`javascript``
osascript('display dialog message', { message: 'Hello from Node' })
.then(() => console.log('Success!'))
MIT, see LICENSE.md for details.