Re:Awesome OS X Command Line
by Retr0spectrum on Friday February 17, 2017 @06:22AM
(#13667465)
I've never seen AppleScript before, and I'm fascinated by the syntax. Is it as easy to write as it is to read?
[ Parent
| on HN ]
Re:Awesome OS X Command Line
by provemewrong on Friday February 17, 2017 @08:46AM
(#13668198)
No. It's probably the most frustrating syntax I've had the (dis)pleasure of working with.
Re:Awesome OS X Command Line
by allenbrunson on Friday February 17, 2017 @11:09AM
(#13669231)
Sadly, I have to agree. The first time you see an AppleScript, you think, wow, that looks great, can't wait to dive in. Two hours later, still can't get the simplest little things to work, start wondering if maybe I can do this with a bash script, or something else ...
Re:Awesome OS X Command Line
by brazzledazzle on Friday February 17, 2017 @10:02AM
(#13668639)
Anything remotely complex is weird and unintuitive. I've had the displeasure of writing AppleScript as both a novice and intermediate scripter/programmer. The latter is much more frustrating because instead of just the "natural language"(for lack of a better term) falling apart you are now very much aware of what it's lacking.
It's been a little while since I last wrote any AppleScript but while I didn't find it completely horrendous to write, it was certainly harder to write than most scripting languages because there is a lot to remember about how a script can and can't be structured.
You can now write in Javascript instead of Applescript (https://developer.apple.com/library/content/documentation/La...). For examples of Applescript equivalent code in Javascript, see https://github.com/dtinth/JXA-Cookbook. Yes, Applescript looks horrible, but it was originally designed for non-programmers, so it had very verbose English-like syntax.
Re:Awesome OS X Command Line
by TheAceOfHearts on Saturday February 18, 2017 @11:59AM
(#13675489)
My experience has been that it's pretty frustrating after a few minutes. It's a dead language with very few references available online. Apple recently added support for using JavaScript wherever you'd use AppleScript, and it wouldn't surprise me if they end up killing it off completely in a few years.