Hi! I want to create a script tool that will start the label for certain layers, that is to add the parameters with the layer to which I want to activate the label and what field I want to display it that I need.. I used this script
import arcpy
mxd = arcpy.mapping.MapDocument("CURRENT")
layer = arcpy.mapping.ListLayers(mxd, "")[0]
if layer.supports("LABELCLASSES"):
for lblclass in layer.labelClasses:
lblclass.showClassLabels = True
lblclass.expression = " [Layer]"
layer.showLabels = True
arcpy.RefreshActiveView()
but it doesn't work to create a script tool, it only works in python windows. Do you have any suggestions?
You need to read the help file and understand how to turn your script into a script tool. Its all in the help file here.