Language Guide

CHAPTER 3
Values
68 Coercing Values
However, the class of a string is always string:
class of "A string" as text
--result: string
Unlike the class identifier Number (which is a synonym for either Real or
Integer) or Styled Text (which denotes a string that includes font and style
information), the class identifier Text is precisely equivalent to a single class
identifier—String.
Coercing Values 3
AppleScript coerces values in two ways:
in response to the As operator
automatically, when a value is of a different class than was expected for a
particular command or operation
The As operator specifies a particular coercion. You can use the As operator to
coerce a value to the correct class before using it as a command parameter or
operand. For example,
set myString to 2 as string
coerces the integer 2 into the string "2" before storing it in the variable
myString. Similarly,
"2" as integer + 8
coerces the string "2" to the integer 2, so that it can be added to the other
operand, 8.