Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

Launch Python script on mxd open?

$
0
0
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

Viewing all articles
Browse latest Browse all 2485

Trending Articles