Selection in Centimeters
Hello, i have this code in order to make a selection of 50cm x 50cm in any document, but it only works in a 72 ppi resolution file. If i run the script in a document with other resolution ( 30 ppi for example ) it makes a 120cmx120cm selection, i want a 50cm x 50cm selection no matter the resolution.
Regards
var doc= activeDocument;
app.preferences.rulerUnits = Units.CM;
punto1x = new UnitValue( '50', 'cm' ).as( 'px' )
punto1y = new UnitValue( '50', 'cm' ).as( 'px' )
punto2x = new UnitValue( '50', 'cm' ).as( 'px' )
punto2y = new UnitValue( '0', 'cm' ).as( 'px' )
punto3x = new UnitValue( '0', 'cm' ).as( 'px' )
punto3y = new UnitValue( '0', 'cm' ).as( 'px' )
punto4x = new UnitValue( '0', 'cm' ).as( 'px' )
punto4y = new UnitValue( '50', 'cm' ).as( 'px' )
doc.selection.select(Array
(Array(punto1x,punto1y), //punto 1//
Array(punto2x,punto2y), //punto 2//
Array(punto3x,punto3y), //punto 3//
Array(punto4x,punto4y)), SelectionType.REPLACE, 0, false); //punto 4//


