Lesson 25. Unit Coercions


Coercing Between Systems

Calculations with Unit Coercions





What’s Next?

Pop quiz:

• How many centimeters in an inch?

• How many liters in a gallon?

• How many yards in a kilometer?

• What is 39 degrees Fahrenheit, in Celsius?

If you’re like us, you probably couldn’t answer any but the first question (2.54 centimeters per inch). Unless we use these calculations regularly, we’re liable to be a bit rusty converting values between measurement systems.

Fortunately for us, on the rare occasions when we need to convert measurement units, AppleScript provides built-in tools that make us look like we really know our stuff. Unit coercions can make even the most complex conversion ...

Get Apple Pro Training Series: AppleScript 1-2-3 now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.