Kbase Article of the Week: Mac OS X: Script Editor Has Two Choices for Saving Compiled Script →

Speaking of weird bugs and scripts, here’s Apple Support on a weird bug that was present in an early version of Mac OS X 10.2:

When using Script Editor to save a new file, there are two choices for compiled script.

When you choose Save As or save a script for the first time, you see two choices for the format:

  • compiled script
  • Compiled Script

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.

Here is John Gruber, writing about the issue on Daring Fireball:

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.

Now it’s been up for over 20 years, but I guess it’s not as critical of an issue as it once was.