4 ms·
You're also not the audience that AppleScript's natural language programming was designed for (similar with Automator). Don't get me wrong, I feel the same pai
by tedmiston 10y ago
You're also not the audience that AppleScript's natural language programming was designed for (similar with Automator). Don't get me wrong, I feel the same pain points, but AppleScript never was a programming language for developers.
- todd8 10y agoYes you're right. Perhaps something like Automator or even Scratch might work for non-programmers instead of AppleScript. I find both of those quite intuitive (although slower to code in for a trained programmer).
- seanp2k2 10y agoIMO just use Lua as it's easy to embed and well-suited for the task of ad-hoc scripting. There's also a large community and plenty of library support to help get weird interactions working.
- CountSessine 10y agoI think its a lot worse than this though; it isn't realistically a language for anyone. Anyone working on almost any task in Applescript is going to be frustrated. In particular, just the ambiguities in the language for doing simple queries on containers makes writing even simple scripts needlessly painful.
- __jal 10y agoThis. I can't remember what it was like before I learned a programming language. I do vividly recall my fights with compilers, however, and imagining trying to guess what Applescript wants in a particular context without reasonable notions of what was going on under the hood, and I would have become a plumber instead. Applescript is horrid. Seriously, every time I try to write something in it, it devolves into Googling for whatever weird, stilted 'natural language' variant is needed in a given context in the best case. The worst case is me wracking my brain for odd ways to write subordinate clauses that might make it happier. Applescript should be used as the definition of a write-only language. People like to bag on Perl, but even if you hate everything about Perl, it is still a vastly more human language than Applescript.
- function_seven 10y ago> Applescript should be used as the definition of a write-only language. It’s the opposite. Applescript is a read-only language. Very difficult to write, but easy to read code that’s already done. Whereas Perl is easy(?) to write, difficult to read. So it’s a “write-only language”.
- mwfunk 10y agoI agree 100%. Various attempts have been made to design "human readable" programming languages, where someone who wasn't familiar with the syntax (or with programming in general) might be able to read some code and get a sense of what it was doing. I've heard that COBOL was designed with this goal in mind- make the syntax a little more verbose and English-like, and in theory nontechnical business people could understand what it was doing. AppleScript took this concept and ran with it. The problem is that while this might (or might not) enhance readability, it definitely hurts writability. You end up with a verbose language with lots of extraneous and ambiguous syntax that isn't really well-defined. I've found AppleScript to be much more confusing than other languages, and if I wasn't a developer I would expect that to be 10x worse. I have met a few people who said they got started with programming by playing with AppleScript, but I can't escape the feeling that they got into programming despite AppleScript, not because of it. Maybe they picked it up first because it's always been pitched as a language for non-programmers, but it just doesn't seem to scale beyond something good for copying and pasting tiny chunks of code to tell an app to do something that otherwise can't be automated. It's useful as a tool to create and send Apple Events (which is really all it is- a wrapper around Apple Events), but its usefulness speaks more to the occasional usefulness of Apple Events as a part of the OS, than AppleScript itself as a language.
- josho 10y ago> AppleScript never was a programming language for developers But, who is it for then? For general users they still made it too difficult to discover how to do things. Perhaps, the failing was simply with the documentation and discovery of the language. Regardless, it's clearly been an area underinvested for quite some time.
- tedmiston 10y agoGiven that it was introduced 20 years ago on System 7 and has survived through Mac OS 8/9/X, it's kind of hard to address the audience question over that timespan. But I think it was always intended to be accessible to end users. Personally, even as an experienced dev, I've found it hard to discover how to do things in AppleScript. The "natural" language can be surprisingly unintuitive sometimes, especially when it breaks down into a program that looks like half OOP / half NLP.
- supernintendo 10y agoAppleScript was originally intended as a way for non-programmers to develop applications, hence the "natural language" syntax. You could think of it as the spiritual successor to HyperTalk / HyperCard. Aside from that, the language served an important purpose in classic Mac OS which lacked preemptive multitasking and thus true IPC. AppleScript was used to allow multiple applications to communicate with one another using a pub-sub model.