'use strict';
var execFile = require('child_process').execFile;

module.exports = function (str, cb) {
	execFile('osascript', ['-e', str], function (err, stdout) {
		if (err) {
			cb(err);
			return;
		}

		cb(err, stdout.trim());
	});
};

'use strict';
var execFile = require('child_process').execFile;

module.exports = function (str, cb) {
	if (process.platform !== 'darwin') {
		throw new Error('Only OS X systems are supported');
	}

	execFile('osascript', ['-e', str], function (err, stdout) {
		if (err) {
			cb(err);
			return;
		}

		cb(err, stdout.trim());
	});
};

Throw error if used on another OS than OS X
Throw error if used on another OS than OS X
