NEW BUGS IN MAC OS 9.1
There are a number of reported new AppleScript bugs in Mac OS 9.1.
The announcement of AppleScript 1.5.5 from The AppleScript Team noted that certain operations on Unicode text (concatenation, equality testing, word or character access) will cause an error or crash. This will be fixed when Mac OS X is released (scheduled for March 24, 2001). See Unicode AppleScript Text Coercions May Fail (TIL #106096 1/4/01, updated 1/16/01).
The same announcement reported that, [d]ue to an error in integrating a new feature, some features of the Read/Write scripting additions are not working. Specifically, writing a list to a text file will corrupt the text file. This, too, will be fixed when Mac OS X is released. Chris Nebel addressed this issue as early as October 24, 2000 in a message to the AppleScript-Users mailing list, reporting that read/write is fundamentally broken in a number of ways, especially when it comes to reading and writing lists and records as binary data. I think it works for flat lists, but nothing else. A workaround is to use Sigma’s Coercions or some other third-party solution.
Mac OS 9.1: Dialog Box Does Not Cancel on First Attempt (TIL #106091 12/19/00, updated 1/9/01) reports that in Mac OS 9.1 the AppleScript dialog box asking you to locate an application if the application cannot be found reopens after you click Cancel. The workaround is to click Cancel three or four times. This problem reportedly also existed in AppleScript 1.4.3 (Mac OS 9.0.4). I have found at least one other dialog that behaves in this fashion, in an Apple scripting addition, so I wonder if it may be a CarbonLib bug. 2/28/01
A number of users have reported that the Path To command in the Standard Additions scripting addition has problems when invoked inside a Finder tell block, at least with respect to the Startup Disk special folder. Workarounds include moving the Path To command outside the Finder tell block and using the Finder’s own command for obtaining the path to the startup disk.
A number of users have reported that the File or other menu titles in Script Editor sometimes flash rapidly. Mr. Tea pointed out that what triggers this misbehavior is the use of a command-key equivalent to exercise a menu command. The flickering stops when you switch to another application and back. It appears to be harmless, if somewhat distracting. Contrary to my earlier belief, it is not cured if you install CarbonLib 1.2 or 1.2.5. I have seen it happen in other Carbonized applications, as well. Some report that it is caused by an interaction with Leonard Rosenthol’s OSA Menu; he is working on an update. 2/28/01
On January 19, 2001, Chris Nebel confirmed on the AppleScript-Users mailing list a reported bug in Mac OS 9.1 in which the Status property in the Remote Access configuration class defined in Network Setup Scripting does not work correctly.
On October 7, 2000, Chris Nebel confirmed on the AppleScript-Users mailing list a reported bug in Mac OS 9.0.4, which persists in Mac OS 9.1, causing your Mac to appear to freeze (actually, to slow down significantly) if you click on the menu bar after double-clicking an already-running applet. On December 10, 2000, Chris indicated that this was actually a pair of bugs, one in the applet shell and one in the default active proc, which he expects to fix for the upcoming release of AppleScript to coordinate with Mac OS X. If you encounter this obscure bug, workarounds are to let the applet’s run handler complete or terminate the applet with command-period.
There have been reports of problems using Apple Data Detectors (ADD) in Mac OS 9.1, at least on newer computers. ADD works correctly for me on a PowerBook G3 Series (Wallstreet). 1/23/01
Apple’s Chris Nebel reported that the improved random number generator in 1.5.5 also changed the seed behavior, so the manual is incorrect. In 1.5.5, if you use ‘with seed 0’, it actually resets the seed to zero. Also, it used to be that if you didn’t supply a seed at all, it would use the current time as the initial seed; now it uses zero… [Y]our best bet is to use the time as seed. In the startup of your script, say ‘random number with seed time of (current date)’. Then use just ‘random number’ (i.e., with no seed) when you need a random number. 9/22/01
Chris Nebel gave some details on formatting bugs that plague the use of long prompt strings in the Choose From List command in Standard Additions. The real problem is that choose from list doesn’t use anything even resembling a line-breaking algorithm to figure out how many lines the prompt is: it just calls StringWidth and divides by the width of the dialog (which depends on how long the list items are; see below.) This means that (1) depending on how the word wrapping works out, you might lose a couple of words off the end, and (2) because StringWidth considers carriage returns to take up no space, you get completely incorrect results if the prompt contains one. On a related point, Chris stated that the maximum visible number of items in the list depends on your screen size, actually. AppleScript 1.4 always used a list big enough for 12 items, no matter how many items you gave it. 1.5.5 adjusts the height of the dialog to show all the items that will fit… It doesn’t take the prompt height into account, so a very long prompt combined with lots of short items will push the buttons off the bottom of the screen. Chris indicated that these problems would persist in AppleScript 1.6 but might be resolved in a later versioin. 9/22/01
Some reported issues aren’t really bugs:
Some users have complained of errors when using commands in Standard Additions or other scripting additions. Others have reported, however, that this is merely a side effect of disabling the various security-related extensions that now must be active in the Extensions folder. These extensions are: Security Cert Module, Security Library, Security Manager, Security Policy Module, and Security Storage Module. Reportedly, only the Security Library must be enabled to make Standard Additions work correctly. 1/23/01
Jon Pugh has noted that the old trick of placing a dummy ObjectSupportLib folder in your extensions folder, to prevent ill-behaved installers from installing an unneeded copy of the library file, prevents installation of Mac OS 9.1. If you use this trick, remove or rename the folder before installing Mac OS 9.1, then reinstate it.
Two of the special folders recognized by the Path To command in the Standard Additions scripting addition are still named At Ease applications folder and At Ease documents folder, although At Ease has been eliminated (or renamed) in favor of the more general multiuser capability. Path to At Ease applications folder returns an alias to the Applications (Mac OS 9) folder under Mac OS 9.1, and path to At Ease documents folder returns an alias to the Documents folder, both at the root level of your startup disk. 1/28/01
I have noticed that use of the Finder’s Computer command apparently now sometimes requires placing it in parentheses to avoid a runtime error. For an example, see the script for testing system versions in the Testing Whether AppleScript 1.5.5 is Installed section, above.