AnsweredAssumed Answered

Launch Python script on mxd open?

Question asked by DNulph on Jan 25, 2013
Latest reply on Jan 28, 2013 by DNulph
We are upgrading/migrating to a new SDE server, leaving my organization with probably thousands of .mxds with datasource references pointing to the old, soon to go away, server.

I could write a py script to rifle through all of these .mxd's and do a datasource replace, but I'm envisioning some problems that could occur.  The end-users are typically casual GIS users, so attempting to instruct all of them how to fix broken data links is probably a non-starter.

My preference would be, on opening an .mxd, to automatically run a script that checks for data sources referencing the old server and offers to replace them for the user, then lets them decide whether to replace the old .mxd or write out a new one.

Is there any way to get ArcMap to run a specific Python script when opening an existing .mxd?  I can access the user's local directories to push/replace files as needed.

Thanks

Outcomes