Get X and Y, and Width and Height of a layer
Posted: Fri Nov 02, 2018 2:48 am
From a script, how do I get the x and y coordinates of a specific layer? Also, how do I get the width and height of a specific layer?
Independent Photoshop® Scripting Community
https://www.ps-scripts.com/
Code: Select all
b = activeDocument.activeLayer.bounds
x = b[0], y = b[1], w = b[2] - b[0], h = b[3] - b[1]
alert(x + ' & ' + y + ' & ' + w + ' & ' + h)