A lot of people in this thread have misconceptions about what AppleScript is and what it means for JavaScript to be an alternative. I recommend watching the WWDC session [1] if you can, and skip to 16 minutes in (through minute 20) for a quick explanation of what this actually is. TL;DR shell scripting for the GUI, not a way to build Mac applications (which you can already do with JS). Edit: video link Double edit: L…
What video?
JavaScript as an alternative to AppleScript on OS X Yosemite
51–60 of 126 posts
Re: JavaScript as an alternative to AppleScript on OS X Yosemite
#52Re: JavaScript as an alternative to AppleScript on OS X Yosemite
#53You know what's pretty cool? This potentially allows native MacOS applications to be written in JavaScript... Not that I can see any reason to do that.
(Downvoters of parent, please stop, it's a perfectly reasonable comment.) While you're correct that JS can now be used to write Mac applications without an Obj-C wrapper, that's not really the point of this. Anyway, you can already write Mac applications in JavaScript. And iOS applications! This has been true since iOS 7 and Mavericks. http://strongloop.com/strongblog/apples-ios7-native-javascri... You can build doub…
Re: JavaScript as an alternative to AppleScript on OS X Yosemite
#54You know what's pretty cool? This potentially allows native MacOS applications to be written in JavaScript... Not that I can see any reason to do that.
(Downvoters of parent, please stop, it's a perfectly reasonable comment.) While you're correct that JS can now be used to write Mac applications without an Obj-C wrapper, that's not really the point of this. Anyway, you can already write Mac applications in JavaScript. And iOS applications! This has been true since iOS 7 and Mavericks. http://strongloop.com/strongblog/apples-ios7-native-javascri... You can build doub…
I'm pretty familiar with ObjC-Javascript integration and have been working with it for a while. This change offers a nice direct system interface for automation, and one that has access to all of Cocoa.
I also didn't intend to put Javascript down at all - its more that the more complex part of building a MacOS app is working with Cocoa, and Javascript will make that more complex, rather than simpler, just because of the impedance mismatch.
I'm not sure there's a compelling use case for building such apps, but it's still pretty cool!
Re: JavaScript as an alternative to AppleScript on OS X Yosemite
#55You know what's pretty cool? This potentially allows native MacOS applications to be written in JavaScript... Not that I can see any reason to do that.
(Downvoters of parent, please stop, it's a perfectly reasonable comment.) While you're correct that JS can now be used to write Mac applications without an Obj-C wrapper, that's not really the point of this. Anyway, you can already write Mac applications in JavaScript. And iOS applications! This has been true since iOS 7 and Mavericks. http://strongloop.com/strongblog/apples-ios7-native-javascri... You can build doub…
Re: JavaScript as an alternative to AppleScript on OS X Yosemite
#56AppleScript contains some amazingly powerful APIs, but is nearly impossible to write. Having a Javascript (successor?) implementation is going to unleash its full potential. I could see it becoming much more widely used and supported by third party apps. This is wonderful. In the same cycle that they release a brand new language, they begin the deprecation process for their (only?) other proprietary programming langu…
As braindead as the language was, the real problem with AppleScript was the bizarre object model, so the Object help doc was full of nonsense methods that did nothing useful. Finding the one method doExactlyOneSpecificThing that matched what you need was always a low-probability event. The opposite of the UNIX philosophy and modular design.
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.
Re: JavaScript as an alternative to AppleScript on OS X Yosemite
#57I love AppleScript because whenever somebody asks, "Why don't they make programming languages more like English?" all you need to do is show them AppleScript. The functionality exposed by OSX apps via AppleScript is often incredible, but the language itself is annoying. The question is whether or not applications will support it. With the emphasis shifting away from OSX desktop applications to cross-platform and clou…
Re: JavaScript as an alternative to AppleScript on OS X Yosemite
#58Earlier quoted context omitted.
(Downvoters of parent, please stop, it's a perfectly reasonable comment.) While you're correct that JS can now be used to write Mac applications without an Obj-C wrapper, that's not really the point of this. Anyway, you can already write Mac applications in JavaScript. And iOS applications! This has been true since iOS 7 and Mavericks. http://strongloop.com/strongblog/apples-ios7-native-javascri... You can build doub…
Yeah, I suspect I was a bit unclear there! I'm pretty familiar with ObjC-Javascript integration and have been working with it for a while. This change offers a nice direct system interface for automation, and one that has access to all of Cocoa. I also didn't intend to put Javascript down at all - its more that the more complex part of building a MacOS app is working with Cocoa, and Javascript will make that more com…
It actually kind of cool. And the Temperature Converter example showed a lot of the dynamic nature of the objective C runtime. This one presentation actually piqued my interest in looking at os x scripting.
Re: JavaScript as an alternative to AppleScript on OS X Yosemite
#59Earlier quoted context omitted.
As braindead as the language was, the real problem with AppleScript was the bizarre object model, so the Object help doc was full of nonsense methods that did nothing useful. Finding the one method doExactlyOneSpecificThing that matched what you need was always a low-probability event. The opposite of the UNIX philosophy and modular design.
is this going to be solved by writing it in javascript though? Looking at the sample code in this page: Mail.outgoingMessages.whose({subject:'JavaScript'}) is doesn't look much better.