How to set/get absolute position of a layer?

This is mostly about getting the absolute translate position of the layer. For example if you press ctrl + t on a layer, it opens the transform tool and you can see the layer’s absolute position (for its middle-center anchor point) in the tools options. And yet when I capture the commands of that tool, it only spits out the offset!

I cant use the bounds of the layer because fill layers that dont have masks always return a bounds of {0,0,w,h}, where w is width of doc and h is height of doc. Deriving the absolute position of group layers that contain a fill layer + other layers is thus impossible, its always skewed towards the origin… unless I iterate through the group layer and specifically build my own custom bounds that ignores fill layers which dont have masks. That would theoretically work though I havent written it yet.

Does anyone know an easier way?