It also didn't help that Apple provided very little support for implementing the language's rich query model, which led to many applications only implementing one or two ways to access objects, often with bugs. That was the source of most of the annoyances with AppleScript.
The most underrated thing to me that made it all worthwhile, though, was Remote Scripting. I think the full potential of it has yet to be realized, and hopefully JavaScript will allow some impressive future developments.
Looking at the sample code in this page:
Mail.outgoingMessages.whose({subject:'JavaScript'})
is doesn't look much better.Edit: found a stack overflow question/answer [1]. It's doing a little additional work beyond searching for mails with a particular subject, but even just the searching functionality is much larger and more convoluted that the single line of js you referenced.
tell application "Mail"
set msgs to every outgoing message whose subject is 'JavsScript'
end tell
So, yes :).doWhatImThinking();
Since the javascript code looks isomorphic to
outgoing messages whose subject is "JavaScript"
I'd think that the issue is not mitigated by a different syntax.<https://developer.apple.com/library/mac/documentation/apples...