TextItem Bounding Box: width, height and x/y coordinates of top left corner
Hello there again,
I want to have the width, height and x/y coordinates of the top left corner of a TextItem object in Pixels.
I already have this( i traverse through every layer, so I already have an active layer, active document and so on):
app.preferences.rulerUnits = Units.PIXELS;
app.preferences.typeUnits = TypeUnits.PIXELS;
var docRef = activeDocument;
//for every layer (i traverse through them) I do:
if (layer.kind == LayerKind.TEXT){
var size = layer.textItem.size.value;
var textSize = new UnitValue (size, 'px');
var height = layer.textItem.size.value;
alert(height); //here I get the same value as the size?
var textheight = new UnitValue (layer.textItem.height.value, 'px');
var xposition = layer.bounds[0].value;
var ypostition = layer.bounds[1]value;
I work with the latest Photoshop Version and this is an .jsx script I scripted in Visual Studio Code with the ExtendedScript Debug.
