I am trying to put together my second tool so pretty new to this. What I want it to do is batch plot MXD's layouts to PDF found in a specific folder, without having to be in ArcMap. I'm trying to run the tool from ArcCatalog solely. When I run the Python script on its own in ArcCatalog and replace the parameter with the folder location, it works just fine. When I try to make it into a tool with the only input being the folder location, it doesn't work. All it does is pop up my script in notepad and says the process is complete.
Can someone tell me what I'm doing wrong?
import arcpy, os ws = arcpy.GetParameterAsText(0) mxd_list = arcpy.ListFiles("*.mxd") for mxd in mxd_list: current_mxd = arcpy.mapping.MapDocument(os.path.join(ws, mxd)) pdf_name = mxd[:-4] + ".pdf" arcpy.mapping.ExportToPDF(current_mxd, pdf_name) del mxd_list