So, I searched through the documentation on AI CS6’s Scripting Reference (JavaScript / though actually ECMAScript), and I cannot find anything for managing units, or unit conversion. Is it missing?
Photoshop uses ECMAScript’s UnitValue object as a standard way for managing unit conversion, but I can’t find anything for Illustrator. Illustrator functions do not accept UnitValue instances – they only accept doubles, in the “points” unit.
How am I supposed to manage units in AI?
Or, if nothing else, how do I run conversions from a given unit to points?
p.s. Why is it points anyway? Is that script-default? My current default unit is inches.
2
Answers
Answers to all your questions can be found in the Adobe Illustrator Scripting Guide (CS6 on the Adobe home page) in the Measurement units section. This section seem to remain unchanged for years.
In particular,
regardless of the current ruler units“
Try setting required units without conversion (replace PIXELS to probably POINTS):