We are trying to use the node-osascript as you have in your documentation:
var osascript = require('node-osascript');
osascript.executeFile('scripts/trash-back.scpt', { varName : 'value'}, function(err, result, raw){
if (err) return console.error(err)
console.log(result, raw)
});
Our simple AppleScript:
display dialog "Welcome to AppleScript."
However, when we run:
npm start
The following error message appears:
> trash-back@1.0.0 start /Users/Francisco/Git/trash-back
> node src/index.js
Error: 32:37: syntax error: Expected end of line, etc. but found real number. (-2741)
at ChildProcess.<anonymous> (/Users/Francisco/Git/trash-back/node_modules/node-osascript/lib/index.js:39:12)
at ChildProcess.emit (events.js:159:13)
at maybeClose (internal/child_process.js:943:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
We are trying to use the
node-osascript
as you have in your documentation:Our simple AppleScript:
However, when we run:
The following error message appears:
What are we doing wrong?