2.7. Summary

In this chapter, you learned

  • How to define variables that you can use in your programs to store values

  • How the set command is used to set the value of a variable

  • How the get command can be used to retrieve the value of a variable

  • The get command is implied when you use a variable in an expression and, therefore, is often omitted.

  • How you can use the log command to enter values into the Event Log, which is a useful tool for tracing the execution of your program and displaying intermediate results

  • In AppleScript, data types are called classes. You also learned how to work with the basic integer, real, string, boolean, and date classes.

  • That you can use parentheses freely in expressions to alter the order of evaluation

  • That you can use the as operator to coerce one data type into another when it makes sense to do so

  • That AppleScript has many built-in classes for working with weights and measures. You saw how you can use these classes to perform your own conversions.

Other classes built into AppleScript were not described here. These include the following: point, RGB color, machine, data, list, record, handler, script, and file. Many of these classes are described later in this book.

In the next chapter, you learn to use AppleScript's relational and logical operators to make decisions in your programs. Before proceeding, however, try the exercises that follow to test your understanding of the material covered in this chapter. You can find the solutions to these exercises in ...

Get Beginning AppleScript® 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.