More evidence that Toronto is the greatest city in the world: it CANNOT be coerced.
Apple Inc. makes this clear in their reference manual Introduction to AppleScript Studio Terminology Reference [sign-in required].
The next example demonstrates the use of the To keyword to capture additional information about an error that occurs during a coercion failure.
The Repeat statement fails because the string “Toronto” is the wrong class—it’s a string, not an integer. The error handler simply writes the values of obj (the offending value, “Toronto”) and newClass (the class of the coercion that failed, integer) to the Script Editor’s Event Log window. The result is “(*Toronto, integer*)”, indicating the error occurred while trying to coerce “Toronto” to an integer.
The proof of the greatness is further amplified that many will take any opportunity to express its greatness as in doing so the greatness is reflected upon them.
Leave a Reply