AnsweredAssumed Answered

Python Script into a Tool for a Toolbar

Question asked by MLCouden on Feb 28, 2013
Latest reply on Feb 28, 2013 by csny490
I know how to add a script tool to a toolbox but I do not know how to make my script into a tool to put on a toolbar. Please help!! My code is below:

import arcpy, os
folderPath = r"C:\2 - GEO-DATA PROCESSING SUPPORT\Permanent Site Maps\2_District MXDs"
for filename in os.listdir(folderPath):
    fullpath = os.path.join(folderPath, filename)
    if os.path.isfile(fullpath):
        basename, extension = os.path.splitext(fullpath)
        if extension.lower() == ".mxd":
            mxd = arcpy.mapping.MapDocument(fullpath)
            pdfPath = r"K:\PRODUCTS\Maps\Printable Maps\Test Permanent Site Maps"
            arcpy.mapping.ExportToPDF(mxd, pdfPath + os.sep + basename.split("\\")[-1] + '.pdf')

Outcomes