Boolean Coercions

A boolean may be coerced to a string; depending on whether the boolean is true or false, this string will be either "true" or "false".

A string may be coerced to a boolean . The string "true" (not case-sensitive) will be true; any other string will be false.

A boolean may be coerced to an integer ; depending on whether the boolean is true or false, this integer will be either 1 or 0.

The integers 1 and 0 may be coerced to a boolean, yielding true and false respectively; other integers can't be coerced to a boolean.

Get AppleScript: The Definitive Guide, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.