I wanto to know if its possible to change something in the second line, to iterate through all data frames in the mxd. It has the option to choose wich df, changing the number inside the racket.
I'm asking that because i want to run a script in all my mxd, in a folder. But i have a lot of them, and some have 3, 4 or five df.
Example: The script gets error, if i choose to run it in  and the mxd doesnt have it. So the script stops.
mxd = arcpy.mapping.MapDocument("CURRENT") # Uses your currently open MXD df = arcpy.mapping.ListDataFrames(mxd, '') # Chooses the first dataframe for lyr in arcpy.mapping.ListLayers(mxd, '', df): # Loop through layers # Any tools you want to run on each layer go here