Fork You

Bugs happen. That’s life.

So there’s a bug in the Jaguar Script Editor. In the Save dialog, there are two choices for saving compiled scripts, differing only in capitalization: “Compiled Script” and “compiled script”.

Three weeks ago, Apple published a Knowledge Base article addressing this bug. Its solution:

The choices produce identical scripts. It does not matter which format you choose; they only differ in the capitalization. This is to expected [sic] to be corrected in a future version of Script Editor.

Sounds good. Too bad it’s completely wrong.

It ends up that the two formats are very different indeed. The lowercase “compiled script” writes the compiled script in the resource fork of the file (which is the traditional format, used since AppleScript’s inception); the uppercase “Compiled Script” writes the compiled script in the file’s data fork (a new format, introduced with Mac OS X).

Both choices write the same script data, but the resulting files are very different indeed. Most apps that read compiled script files only understand the traditional resource fork format. (Notably, this includes BBEdit and Mailsmith; I first saw this bug referenced on the Mailsmith-Talk mailing list over a month ago.)

If you save a script using the “Compiled Script” data fork format, then try to execute it in an app which doesn’t understand the format, you get an error message complaining about an “unexpected end-of-file”.

The bug in Script Editor is excusable; the Knowledge Base article, however, is not. It’s just plain wrong, and it’s been up for over three weeks.

Speaking of AppleScript

John C. Welch’s report on “The State of AppleScript” (part one, part two) is worth reading. Choice cut from part two:

So, let’s see; if I want the leading email AppleScript implementation, I go to…Microsoft. For creative professional applications, I go to…Adobe and Media 100. For contact management scripting, I go to…Microsoft or Power On Software. For IM client scripting, I go to…AOL. For systems management I go to…Netopia/Alsoft/Dantz/Dartware. At exactly what point other than the OS does Apple take the lead here? Oh wait…iDVD.

I’ll put Mailsmith’s scripting implementation up against Entourage’s any day, but the point is still valid — most software coming out of Apple these days has half-baked scripting support, at best.