Live data from Hacker News

JavaScript as an alternative to AppleScript on OS X Yosemite

developer.apple.com

71–80 of 126 posts

Re: JavaScript as an alternative to AppleScript on OS X Yosemite

#71
This is just so insanely insane. I have such mixed feelings about this.

On one hand, it's really exciting that Apple is taking these huge steps in making our lives as programmers easier. And yeah, I wish they had done this when JSTalk came out, but better late than never.

On the other hand, it really sucks that JavaScript is the new universal scripting language. Swift and JavaScript are now the two blessed languages on Apple platforms. I mean, I get why, but man, JS is just so awful.

Re: JavaScript as an alternative to AppleScript on OS X Yosemite

#72

Earlier quoted context omitted.

I don't think that's the case. AppleScript is the equivalent of shell scripting for GUI appls. You don't write applications in AppleScript; you use AppleScript to control other applications in an automated way. You can write AppleScripts with simple dialog boxes and such, just as you can write interactive bash scripts. And while you could theoretically implement an application entirely as a shell script or batch file…

While never particularly popular, both Apple (AppleScript Studio and subsequent AppleScript Xcode templates) and third parties (FaceSpan) have provided full IDEs for developing applications with AppleScript.

I didn't know that!

Re: JavaScript as an alternative to AppleScript on OS X Yosemite

#74
post #57

I 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…

HyperTalk was surprisingly ok, though.

HyperTalk was brilliant because everything seemed to just naturally work. The grammar and object model were both highly intuitive – you really could just guess the right syntax.

AppleScript and HyperTalk are aesthetically very similar but every time I have to write something in AppleScript I get oddball parse errors that I can never decipher and I need to randomly try things until an approach succeeds (for reasons I don't understand) or I give up.

Where HyperTalk was friendly and forgiving, AppleTalk is punishing.

Re: JavaScript as an alternative to AppleScript on OS X Yosemite

#75

I 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…

You show them AppleScript and SQL and they say "Wow, what was I thinking, english is a terrible basis for a programming language."

[deleted]

Re: JavaScript as an alternative to AppleScript on OS X Yosemite

#76

I 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…

AppleScript is not a solid argument against natural language derived programming languages in general. AppleScript's problems have more to do with the fact that it looks like it should be flexible and powerful but in reality it is fairly limited and inflexible (and its documentation and error reporting are terrible, compounding its problems).

Re: JavaScript as an alternative to AppleScript on OS X Yosemite

#77
post #21

Stupid and uninformed question here: Given Apple's well-known antipathy to the idea of browser engines other than WebKit and scripting languages other than JavaScript on iOS (yes, yes, I know you can find Python/Lua/Lisp/whatever apps on iOS; I mean as a general rule and for inter-app automation), could this be a prelude to allowing some sort of sandboxed-app automation interface on iOS? That is, allow a JavaScript i…

Javascript in this case has nothing to do with web browsers. It is simply a scripting language used to manipulate OSA (Apple's cross-application automation API in Mac OS X). Since OSA is not part of iOS, this likely won't affect iOS at all.

You actually can use Javascript to automate iOS apps running in Instruments (one of Apple's developer tools). This is used for automated UI testing in the iOS simulator or while your iOS device is tethered to a Mac. This has been around for a couple years and there's no indication that it will ever be permitted in released applications. There's actually no reason to enable it – it's only useful for snooping on apps (good for developers, bad for users).

Re: JavaScript as an alternative to AppleScript on OS X Yosemite

#78

This is just so insanely insane. I have such mixed feelings about this. On one hand, it's really exciting that Apple is taking these huge steps in making our lives as programmers easier. And yeah, I wish they had done this when JSTalk came out, but better late than never. On the other hand, it really sucks that JavaScript is the new universal scripting language. Swift and JavaScript are now the two blessed languages…

From the spec, it seems that they've improved on a few things (integers being the big one).

Re: JavaScript as an alternative to AppleScript on OS X Yosemite

#79

Earlier quoted context omitted.

While never particularly popular, both Apple (AppleScript Studio and subsequent AppleScript Xcode templates) and third parties (FaceSpan) have provided full IDEs for developing applications with AppleScript.

I didn't know that!

Incidentally, I'd still mostly agree with your comment, as the underlying script runtime isn't really designed with application development in mind. For example, I'm pretty sure Xcode debugging support for AppleScript doesn't even include breakpoints or related features like single-stepping (Apple's Script Editor certainly doesn't), and that Script Debugger had to pretty much implement its own AppleScript runtime to support these features.

On another side note, while Yosemite is the first time Apple has supplied or supported JavaScript as an OSA language, third parties have integrated the Mozilla JavaScript engine into OSA in the past in what I believe is an abandoned project (Google "JavaScript OSA").

Post reply on HN