AppleScript 1.10 (Tiger 10.4)

AppleScript 1.10 was released as part of Mac OS X version 10.4 and requires Mac OS X version 10.4 or later. Since this was the first Tiger release of AppleScript, there are a bunch of changes. Some are bug fixes, other are enhancements of existing features, and some are downright new.

Apple provided the usual disclaimer in their release note. It states that scripts written for older versions of AppleScript will work in 1.10 and that scripts written for 1.10 will work with versions back to version 1.1 if they don’t use features added since that version.¨
Notes:

Version Numbering
Since this is the first “double-digit” version of AppleScript, Apple noted that you must use the new considering numeric strings statement before comparing this version with previous versions. If you don’t, “1.10” will compare less than “1.9” in a normal string comparison.

If your script converts the version to a real number (via coercion) then you may also have problems, since the version number is now allowed to contain 2 digits for both the second and third digit. So now version 1.2.3 would coerce to 1.0203 instead of 1.23 as a real number. And 1.10 coerces to 1.10 and the previous version, 1.9.3 coerces to 1.0903 in order to keep 1.10 larger than 1.0903.

Apple suggests using the Gestalt version (system attribute “ascv”) to do version comparisons.

Strings
String concatenation has been changed to that if the strings being concatenated are of differing string types, the “richer” type is used for the result. This means that if you concatenate a plain string with a unicode text string, the result will be unicode text, since it supports more characters.

Strings containing only a “+” or “-” can no longer be coerced to a number (assumably zero).

Using count to get the number of paragraphs or text items of a unicode string now results in a value of 1, not 0. This is because the string is considered to contain at least 1 paragraph or text item, it just may be empty. This is different that the method used for standard text strings. With standard strings, the result is 0.

The implicitly encoded text types typeText, typeCString, and typePString have been deprecated since 1.9.2, but Apple reiterated this in their release notes. Bottom line: Don’t use them.

Do Shell Script
Do shell script should not be used with both administrator privileges AND the sudo shell command. If you do so, sudo will hang the script waiting for input on a non-existant terminal.

Do shell script now uses setuid-root for privileges to run scripts rather than root. Some things will operate differently because of this; perl will no longer accept -e options. This change could break existing scripts that rely on root privileges.

Error codes for do shell script are different. No information on HOW they are different.

Miscellaneous Changes
Path to me now returns the right path for compiled scripts even if they are run using the run script command.

Mount volume can no longer mount OS 9 server volumes using an AppleTalk server name. You must use the TCP server name or an IP address.

If you use display dialog with the with icon parameter and the icon doesn’t exist, Applescript will report an error. In the past, this was ignored.

The list returned by list disks is now unicode text, not standard text.
1.9.2.

AppleScript Bug Fixes

Strings
Strings that contain only a plus or minus sign, can no longer be coerced to a number.

The numeric value classes, the enumerated value class (typeEnumerated), and the type value class (typeType) can now be coerced to and from Unicode text and styled text.

The Unit Type value classes (e.g., miles, gallons) can now be coerced to and from Unicode text.

The version class (typeVersion) can now be coerced to Unicode text.

Plain text (typeText) can now be coerced to styled text (typeStyledText).

Getting the first word of an empty Unicode string no longer causes a crash.

Getting an arbitrary element of Unicode text using some (e.g., some word of theUnicodeText) now produces more random results.

Getting the count of a non-existent element of Unicode text (e.g., count files of theUnicodeText) now returns 0. Previously, it returned the number of characters.

Getting the count of the paragraphs or text items of an empty Unicode string now returns 1 instead of 0.

A problem that caused some styled text comparisons to fail when the primary language was set to Japanese has been fixed.

Backslash characters and Yen sign characters will now compile correctly when the primary language is set to Japanese.

The ‘¬’, ‘÷’, '≠', ‘≤’, and ‘≥’ characters will now compile correctly when the primary language is set to Japanese, Korean, or Chinese.

URL and File Specs
A coercion from typeFileURL to object specifier has been added.

Coercing a file specification (typeFSS) to an object specifier now works correctly for filenames that are longer than 31 characters.

Coercing an alias to an object specifier would crash in certain circumstances if the alias could not be resolved. This has been fixed.

“file://localhost” as URL no longer causes a crash.

Getting the POSIX path of a path string that is already POSIX now returns the correct results.

Long volume/folder/file names no longer cause errors.

Applications
tell application “AppName” will now look for a Mac OS X application named “AppName.app” before looking for a Classic application named “AppName”. Previously, the Classic application was found first.

Long application names are no longer truncated when used in a tell statement.

Long application names are no longer truncated in the “Where is xxx?” dialog.

Scriptable Cocoa applications that contain Resource Manager resources, but do not contain an ‘aete’ resource, are now recognized as scriptable.

A compilation problem that caused the last character of an enhanced application URL specification to be removed has been fixed.

Bundled applets created using AppleScript 1.9.x always appear to be named “applet” when targeted from a remote machine. This has been fixed for bundled applets created with AppleScript 1.10 and later.

Bundled applets created using AppleScript 1.9.x erroneously display the “Open in the Classic environment” checkbox in the Finder’s Get Info window. This has been fixed for bundled applets created with AppleScript 1.10 and later.

AppleScript Internal Fixes
If a with timeout statement specifies a timeout of more than 8947848 seconds, the timeout will be set to 8947848 seconds. Previously, an error was reported.

Distance and weight conversions are now more accurate.

The size of the internal symbol table has been increased which enables larger scripts to be compiled.

The size of the internal runtime stack has been increased which enables larger static lists to be created.

The default formatting is now localizable.

The “References” formatting category is no longer used.

A divide by 0 within a try block within a repeat block no longer causes a hang.

Crashes that would occur in certain circumstances after garbage collection have been fixed.

Memory leaks have been fixed.

Several error reporting problems have been fixed.