Animator vs Animation

Animator vs Animation. If you only watch one Flash animation this year… Really impressive.

State of the Script

One of the best things in Mac OS X is AppleScript, Apple’s scripting language.

AppleScript is different than most other scripting languages in two big ways. The first is a doozy - AppleScript wraps an underlying interprocess communication construct in Mac OS and Mac OS X called Apple Events to allow for access to the innards of other programs.

Every application in Mac OS X that’s not a plain command line tool can provide its own scripting dictionary (in the resource fork for old, Mac OS 9-style, PEF binaries, and inside the resource folder in bundle applications) to map the Apple Events it may implement internally to functions, and provide access to data types and collections of objects. The practical upshot of that is that with very few lines of code, you can get, for example, the name of the currently playing song in iTunes, or tell Transmit to upload a folder somewhere, or why not lay out a page in your page layout program - Mail Merge on crack.

This sounds terrific. And here ends the awesome parts of our saga. You see, AppleScript has a lot of problems.

Its syntax has been developed to look actual English sentences. This was an effort to make the language more approachable to The Man on the Street, and you can’t blame them for having such noble goals as to make scripting approachable. The net result, however, is this: developers used to ‘normal’ programming languages are very often uncomfortable around AppleScript, and The Man on the Street - one Man, specifically, because numerous other Men will have given up by then - will be frustrated over massaging this English of his to make an script that’s a) syntactically correct and b) actually does something.

Does Apple know about this? Apple has known about this from the very beginning. “Dialects” were soon introduced to AppleScript to provide the base keywords in French and Japanese, making for some very polyglot scripts unless your apps were similarly internationalized, and another dialect that looked like C was discussed but didn’t show up outside of Apple before dialects were canned altogether.

Writing broken English I can live with. If this was AppleScript’s only problem, it’d still be pretty good. But it’s not. AppleScript is tremendously lacking in two other areas: base functionality and outdated and downright bad documentation.

How do you search and replace or split a string in AppleScript? With the English-likeness aspect, you might think the function call would be “search” or “replace” or “split”. Instead, you have to diddle with “text item delimiters”, hooks for controlling text coercion into lists (a bastard child of $" and $/ in Perl) smelling like implementation details held out to make debugging easier. There are no methods for such basic functionality, even in the oxymoronically named “Standard Additions”.

Well, then, how did I learn this? From basic AppleScript tutorials on the web. I certainly didn’t learn it from the AppleScript Language Guide, updated mid-1999, referring to AppleScript 1.3.4 shipped in Mac OS 8.5.1. (For those keeping track at home, we’re now up to AppleScript 1.10.7 in Mac OS X 10.4.7.) If you look up something in one of those scripting dictionaries shipping with AppleScript-enabled applications, it very often refers to a data type that seems impossible to create and is only documented in the above hard-to-find, perceivably outdated Language Guide reading more like a raw, BNF-like specification than a pedagogic technical document like most of Apple’s documentation.

Not to mention the bad state of AppleScript dictionaries in Apple’s own apps.

Maybe I’m being bitter here. Implementing AppleScript support in Cocoa has been reduced from a major pain in the ass to merely a five-hour headache with the arrival of a newer format for scripting dictionaries and better documentation. AppleScript is clearly very useful, playing its odd bird role in the variety of languages you can use on Mac OS X well. And it’s possible to do very amazing things without needing to reverse-engineer or scrape intrinstic data formats, especially with the AppleScript Studio wrapping of Cocoa, allowing for basic, AppleScript-native Cocoa apps.

But for all its positive sides, there are a lot of hurdles that are holding back a good technology. AppleScript is in need of immense developer fanservice, and I’m hoping this is on the agenda for Mac OS X 10.5.

Congratulations, IBM. Seriously.

I’ll bet you five bucks that IBM had no idea what they would kick off August 12, 1981 — 25 years ago today — when the first PC was released. It wasn’t new or innovative, but it marked the entrance of the 800-pound mainframe gorilla into a world of small computers, fit for individuals instead of businesses. Oh, and high-resolution, graphically dazzling, immersive and challenging gameplay.

Ur

“If, in your office, you as an intellectual worker were supplied with a computer display, backed up by a computer that was alive for you all day and was instantly responsive for every action you had, how much value could you derive from that?”

Watch Douglas Engelbart and The Mother of All Demos.

« Newer posts · Older posts »