<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Launch Python script on mxd open? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/launch-python-script-on-mxd-open/m-p/661182#M51372</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you are using ArcGIS 10.1, you can create a Python add-in (application extension) with code that executes on the open document event.&amp;nbsp; Here is a page from &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/main/10.1/index.html#/Application_Extension/014p00000019000000/" rel="nofollow" target="_blank"&gt;ESRI's help listing the events that you can respond to with Python&lt;/A&gt;&lt;SPAN&gt;.&amp;nbsp; The help page for application extensions has a &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/main/10.1/index.html#//014p00000018000000" rel="nofollow" target="_blank"&gt;python example of code that executes on the open document event&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Jan 2013 07:20:28 GMT</pubDate>
    <dc:creator>MelanieMaguire</dc:creator>
    <dc:date>2013-01-28T07:20:28Z</dc:date>
    <item>
      <title>Launch Python script on mxd open?</title>
      <link>https://community.esri.com/t5/python-questions/launch-python-script-on-mxd-open/m-p/661181#M51371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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.&amp;nbsp; 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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there any way to get ArcMap to run a specific Python script when opening an existing .mxd?&amp;nbsp; I can access the user's local directories to push/replace files as needed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jan 2013 19:06:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/launch-python-script-on-mxd-open/m-p/661181#M51371</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2013-01-25T19:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: Launch Python script on mxd open?</title>
      <link>https://community.esri.com/t5/python-questions/launch-python-script-on-mxd-open/m-p/661182#M51372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you are using ArcGIS 10.1, you can create a Python add-in (application extension) with code that executes on the open document event.&amp;nbsp; Here is a page from &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/main/10.1/index.html#/Application_Extension/014p00000019000000/" rel="nofollow" target="_blank"&gt;ESRI's help listing the events that you can respond to with Python&lt;/A&gt;&lt;SPAN&gt;.&amp;nbsp; The help page for application extensions has a &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/main/10.1/index.html#//014p00000018000000" rel="nofollow" target="_blank"&gt;python example of code that executes on the open document event&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jan 2013 07:20:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/launch-python-script-on-mxd-open/m-p/661182#M51372</guid>
      <dc:creator>MelanieMaguire</dc:creator>
      <dc:date>2013-01-28T07:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: Launch Python script on mxd open?</title>
      <link>https://community.esri.com/t5/python-questions/launch-python-script-on-mxd-open/m-p/661183#M51373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I should have mentioned, we are at Desktop 10.0.&amp;nbsp;&amp;nbsp; Unfortunately, I have to upgrade the database (9.2) to 10.0 before I can upgrade my Desktops to 10.1.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I'd much prefer to get the database out of the way before tackling the Desktop upgrades, but I'll definitely investigate the Python add-on at 10.1, which would at least minimize the gap where I can't automate some of the broken datasource issues.&amp;nbsp; Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jan 2013 12:32:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/launch-python-script-on-mxd-open/m-p/661183#M51373</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2013-01-28T12:32:47Z</dc:date>
    </item>
  </channel>
</rss>

