psdump is a small, command line based tool to extract layout from Photoshop files into one of several text-based formats.
In other words, psdump parses Photoshop files and outputs their layer hierarchy as a text, JSON, or XML data. The position and size of each layer are included in the output.
Detailed instructions on how to install and use the psdump utility on your Mac are available HERE.
psdump is cross-platform and it works on Mac OS X and Windows. Binaries for the Windows platform are available on the project's homepage.