Why is PageItem.resize() unit independent? What other methods are?
I am continuing my journey through InDesign scripting units and values blues. I am currently trying to resize a PageItem and have found the following code resizes the selected PageItem in 'points' not my viewPreferences.horizontalMeasurementUnits, 'millimeters'.
document.selection[0].resize( CoordinateSpaces.pasteboardCoordinates, AnchorPoint.centerAnchor, ResizeMethods.ADDING_CURRENT_DIMENSIONS_TO, [ 100, 0 ] );
I am still trying to work out the best way to work with units and values of size. I thought all properties and methods used the documents viewPreferences unit properties when dealing with values of size… Turns out I was wrong!
I am asking the experienced scripters:
- Considering all methods that manipulate, measure, compare or return values of size, what would be the ratio of methods that are unit dependent vs unit independent be? I.e. viewPreferences vs points.
- If Adobe were to work on making this more consistent in the future which direction do you think they would go?
I ask so that I can pick a methodology that I feel will be simpler across a wider range of methods and possibly be more future proof.
