What's New in Illustrator Scripting CC 2023 v27.1.1 (December 2022)
The RulerUnits list was fixed for units: meters, feets, feets & inches, yards. Uservoice.
Full list for activeDocument.rulerUnits:
RulerUnits.Pixels
RulerUnits.Points
RulerUnits.Picas
RulerUnits.Inches
RulerUnits.Millimeters
RulerUnits.Centimeters
RulerUnits.Meters
RulerUnits.Feet
RulerUnits.FeetInches
RulerUnits.Yards
In older versions of Adobe Illustrator, you still have to use tricks to define units. What I used: read activeDocument.XMPString and use RegExp to parse document units. Example from *.ai structrure: <stDim:unit>Yards</stDim:unit>. Another problem: until the document is saved, we can't know if the units have changed.
