Adobe 27510753 Scripting Guide - Page 28
Measurement units, Character, Meaning, Example
UPC - 718659445294
View all Adobe 27510753 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 28 highlights
20 Getting Started with InDesign Scripting Adobe InDesign CS2 Scripting Guide AppleScript tell application "Adobe InDesign CS2" set mySelection to item 1 of selection move mySelection to {"2p", "6p"} end tell VBScript Set myInDesign = CreateObject("InDesign.Application.CS2") myInDesign.Selection.Item(1).Move Array("2p","6p") JavaScript with(app){ mySelection = selection[0]; mySelection.move(["2p", "6p"]); } Measurement units When you send measurement values to InDesign, you can send either numbers (for example, 14.65) or measurement strings (for example, "1p7.1"). If you send numbers, InDesign uses the publication's current units of measurement; if you send measurement strings, InDesign uses the units of measurement specified in the string. InDesign returns coordinates and other measurement values using the publication's current measurement units. In some cases, these units do not resemble the measurement values shown in the InDesign Transform palette. If the current measurement system is picas, for example, InDesign returns fractional values as decimals, rather than using the picas-and-points notation used by the Transform palette. "1p6," for example, is returned as "1.5." InDesign does this because your scripting system would have trouble trying to perform arithmetic operations using measurement strings-trying to add "0p3.5" to "13p4," for example, would produce a script error; adding .2916 to 13.333 (the converted pica measurements) will not. If your script depends on adding, subtracting, multiplying, or dividing specific measurement values, you might want to set the corresponding measurement units at the beginning of the script. At the end of the script, you can set the measurement units back to whatever they were before you ran the script. Or you can use measurement overrides, as many of the example scripts do. A measurement override is a string containing a special character, as shown in the following examples. Character p pt mm cm c i (or in) Meaning picas (optionally with additional points after the p) points millimeters centimeters ciceros (optionally with additional didots after the c) inches Example 1p6 18pt 6.35mm .635cm 1.4c .25i