Page 1 of 1

Get X and Y, and Width and Height of a layer

Posted: Fri Nov 02, 2018 2:48 am
by jaysmith123
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?

Re: Get X and Y, and Width and Height of a layer

Posted: Fri Nov 02, 2018 7:11 am
by Kukurykus

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)

I sent you PM if you have more questions...