Thank you for your responses.I'm not sure I was clear in my explanation. The 'event' that drives the script is a process within arcmap. For example, a template mxd is opened and the user changes the view from data view to layout view. This action runs the script in the background creating entries into the text fields on the map layout. Effectively the key is automation, not for someone to have to click on a tool button to run the script.
import arcpy import os blankPath = r"c:\temp\blank.mxd" savePath = r"c:\temp\test.mxd" mxd = arcpy.mapping.MapDocument(blankPath) mxd.author = arcpy.GetSystemEnvironment("USERNAME") mxd.saveACopy(savePath) del mxd os.system(savePath)
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.