Basics of AppleScript

Coercion

Script [5.6.1]:

set input to "15" as number
set numToString to 15 as string

Explanation: input variable was string but as we specified it to be number, it becomes of type number and stores 15. numToString was number type but as we specified string, it stores “15”. This is coercion.

Figure 5.6.1

Figure 5.6.1 Output of Number as String

Figure 5.6.1-2

Figure 5.6.1-2 Number as String