I am trying to learn how to create automation scripts in macOS with the JavaScript language. I was trying to figure out how to make a script that would send an email. Everything seemed to be going fine until I got an error message that said Error on line 12: Error: No error. I've searched the web and haven't found any other occurrences like this.

Script Editor error message popup

This is the code that I ran:

var currentApp = Application.currentApplication();
currentApp.includeStandardAdditions = true;
var Mail = Application('Mail');

var messageName = Mail.OutgoingMessage();

messageName.sender = 'email@example.com';
messageName.subject = 'Test';


The error appears to be for the Mail.send(messageName) line.

Can anyone explain to me why I got this message and what I need to do to fix it? Is it just a bug with Script Editor?

  • 1
    Task failed successfully. Using JS syntax in AS is new to me.. What reference are you following? stackoverflow.com/questions/50898354/… This is the same problem with different approach.
    – anki
    Oct 3 '19 at 19:06
  • 1
    I am using the Script Editor dictionaries and documentation from the Apple Developer site. There is a dropdown list in the dictionary to select between AppleScript, JavaScript, and Objective-C.
    – RyDev
    Oct 3 '19 at 19:24
  • Cannot concatenate text in JXA See if this is helpful. goal is sending email there too
    – anki
    Oct 6 '19 at 15:28

You must log in to answer this question.

Browse other questions tagged .