Get X and Y, and Width and Height of a layer
-
- Posts: 3
- Joined: Fri Nov 02, 2018 2:33 am
Get X and Y, and Width and Height of a layer
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?
- Attachments
-
- x and y and width and height.PNG (1.62 KiB) Viewed 6007 times
Re: Get X and Y, and Width and Height of a layer
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...