AppleScript automatically recognizes a value’s data type based on how you use it. For instance, any value enclosed inside a pair of matching double quotation marks is treated by AppleScript as a string type.
set x to "Alexander Ford"
On the other hand, assigning a numeric value as shown next results in a numeric assignment. Note that numeric values are not enclosed within double quotation marks.
set x to 10
If, however, you enclose a number within double quotation marks as shown next, AppleScript will assign the value a string data type.
set x to "10"
AppleScript also lets you make an explicit data type assignment using an as clause, as demonstrated here:
set x to 10 as string
This is an example of explicit coercion. It is often ...