Adobe 27510753 Scripting Guide - Page 74
Specifying measurement values, UnitValue object
UPC - 718659445294
View all Adobe 27510753 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 74 highlights
66 Using ExtendScript Tools and Features This figure shows confirmation dialogs with a title value specified. Adobe InDesign CS2 Scripting Guide Specifying measurement values ExtendScript provides the UnitValue object to represent measurement values. The properties and methods of the UnitValue object make it easy to change the value, the unit, or both, or to perform conversions from one unit to another. UnitValue object Represents measurement values that contain both the numeric magnitude and the unit of measurement. UnitValue object constructor The UnitValue constructor creates a new UnitValue object. The keyword new is optional: myVal = new UnitValue (value, unit); myVal = new UnitValue ("value unit"); myVal = new UnitValue (value, "unit"); The value is a number, and the unit is specified with a string in abbreviated, singular, or plural form, as shown in the following table. Abbreviation in ft yd mi mm cm m km pt pc tpt Singular inch foot yard mile millimeter centimeter meter kilometer point pica traditional point Plural inches feet yards miles millimeters centimeters meters kilometers points picas traditional points Comments 2.54 cm 30.48 cm 91.44 cm 1609.344 m inches / 72 points * 12 inches / 72.27