The Position of The Top Left Corner of Any Shape Layer
Hi there guys,
So for the last couple of days I've been working on a script that would allow me to center X number of layers to middle of the containing comp, just like if the selected layers were just one layer. So my approach to achieve that is first to know the positions of each layer's four corners. My code so far is working perfectly with AVLayers and TextLayers, however it doesn't always work with ShapeLayers. Here is the formula I'm using to calculate the position of the top left corner of shape layers:
x = position
y = position
So the formula assumes the anchor point is on the middle of the shape layer if the anchor point is [0, 0], and that seems incorrect.

And this is the layer's properties.

So the question is, what is the way to calculate the position of the top left corner of ANY shape layer?
Thank you so much!