O'Reilly logo

Learn AppleScript: The Comprehensive Guide to Scripting and Automation on Mac OS X, Third Edition by Hanaan Rosenthal, Hamish Sanderson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required