I recently found this layer properties script that summarizes layer properties in a single file or a directory and all subdirectories: http://www.esri.com/esri-news/arcuser/winter-2015/create-a-python-tool-that-summarizes-arcmap-layer-properties. It would be enormously useful to me if it worked. It does, in one case: running it on the MXD (not the directory) included with the downloaded sample file exactly as download.
The first problem is the tool doesn’t find layers within groups. Many of my maps have groups or even a group under which I have all my layers. When modifying the layout on a map with lots of data, turning off all the layers speeds time to make changes to the layout; adding a top-level group under which I have all layers means all I have to do it turn off the group to turn off all the layers. Also, I find grouping a good way to organize layers and a great way to develop several maps within a single MXD. To test my hypothesis, I put some layers in the downloaded file within a group, and those layers did not appear in the generated CSV.
The second problem is the tool doesn’t work on directories. The error I get is on this line:
for filename in filenames[2]:
And the message is:
NameError: name ‘filenames’ is not defined
Best Answer
For the second problem, I contacted the author (as suggested by DWynne) who gave the correction:
That corrected the problem. The author told me he contacted Esri shortly after this made it into print but Esri hasn't changed it on the web. He told me he'd contact them again.
For the first problem of this script not listing layers in a group layer, this ought to fix that. Where the code says:
I added after it (sorry, I know the indenting isn't correct)
I found this on an Esri Help page. I'll try it out when I'm back at work. I hope this helps others who have run across this issue.
I have tested this with the problem of the script not listing layers within a group. I also expanded it to allow the output CSV to be automatically named based on the file or folder entered. Here is my code; I hope someone can make use of it.
Thanks to all, especially the original code author.