FWeinb/node-osascript

Expected "false", "true", "{", date, number or string but end of input found.

Closed this issue · 2 comments

I'm pretty sure my script is solid but I keep getting this error, I'd love to fix the script if it's broken or I'm going to have to null out the error :/

Script

var osxbg = function(filename, callback) {
  osascript.execute([
    'tell application "Finder"',
    'set desktop picture to POSIX file "' + filename + '"',
    'end tell'
  ].join("\n"), function(err, result, raw) {
    if (err.message == 'Expected "false", "true", "{", date, number or string but end of input found.') err = null;
    console.log(err);
    console.log(result);
    console.log(raw);
  });
}

error

{ [SyntaxError: Expected "false", "true", "{", date, number or string but end of input found.]
  message: 'Expected "false", "true", "{", date, number or string but end of input found.',
  expected: 
   [ { type: 'literal', value: 'false', description: '"false"' },
     { type: 'literal', value: 'true', description: '"true"' },
     { type: 'literal', value: '{', description: '"{"' },
     { type: 'other', description: 'date' },
     { type: 'other', description: 'number' },
     { type: 'other', description: 'string' } ],
  found: null,
  offset: 0,
  line: 1,
  column: 1,
  name: 'SyntaxError' }
undefined
{ buffers: [], length: 0 }

It's fixed in 1.0.1 Thanks for reporting.

Hey @FWeinb can I get a npm publish on this??