Chapter 8. Working with Numbers

No matter what you do in AppleScript, numbers and math are everywhere—page layout automation, database interaction, and system administration; all require some kind of number manipulation. Some of my graphic-intensive scripts even forced me to pick up a trigonometry book and figure out triangles, sines, and cosines! Throughout the book, you will be attacking number problems and using the concepts covered in this chapter.

Introducing Integers and Reals

AppleScript supports two classes of numbers: integer and real. An integer is a whole number without a decimal fraction and with no potential of ever getting one. Integers can, however, be negative numbers. Real numbers, on the other hand, have decimal points, even if ...

Get Learn AppleScript: The Comprehensive Guide to Scripting and Automation on Mac OS X, Third 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.