Adobe Javascript: Getting the position of a layer?

I’m trying to write a script inside of photoshop which can trim and export all of the layers as .PNG files and also write a text file which lists the X Y coordinates of each layer in the file, along with the widths and heights. I’ve figured out how to get width and height after trimming, but I can’t find any function for listing the coordinates of the layers. Does such a thing exist? Thanks in advance to anyone who can tell me the function that will do this!