First off: when typing code in the forum window, wrap it in code tagsThe pound button (#) in the formatting buttons will insert the tags for you.Whitespace is important with python, and without the code tags, leading white space is weeded out.Next, you want a path name to your mxd, and the full mxd file name.If this script is to run inside arcMap (in the python window, for example), then you can just use the keyword "CURRENT" instead of a full path.If you have multiple data frames, you may want to cycle through them,getting the layers from each. Use ListDataFramesimport arcpy
mxd = arcpy.mapping.MapDocument(r"c:\workDir\FILENAME.mxd")
dfList = arcpy.mapping.ListDataFrames(mxd)
for df in dfList:
lyrList = arcpy.mapping.ListLayers(mxd, "", df):
print "Data Frame: ", df.name
for lyr in lyrList:
if lyr.supports("DATASOURCE"):
source = lyr.dataSource
else:
source = "undefined"
print "Layer: " + lyr.name + " Source: " + source