#prints a list of the selected layers in the TOC along with the number of selected records mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd)[0] for lyr in arcpy.mapping.ListLayers(df): selectedCount = len([int(fid) for fid in arcpy.Describe(lyr).fidset.split(";") if fid != '']) if selectedCount > 0: print "The " + str(lyr) + " layer has " + str(selectedCount) + " records selected..."