Previous Page
Next Page

13.4. Boolean

A boolean is a datatype consisting of exactly two possible values: true and false . The main use for a boolean is as a condition in a control statement, such as if or repeat while (see Chapter 19). It often appears also as a way of setting yes-or-no options in a command; for example, the choose file command (discussed in Chapter 21) lets you submit a boolean to indicate whether invisible files and folders should be displayed. Some common commands, such as exists, return a boolean. AppleScript has a number of operators that generate or combine booleans (listed in Chapter 15).

class of true -- boolean
class of (1 < 2) -- boolean


Previous Page
Next Page