<?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: Change metadata of my map using a custom script tool in ArcGIS Pro in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/change-metadata-of-my-map-using-a-custom-script/m-p/367501#M29000</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/arcpy/metadata/metadata-class.htm" title="https://pro.arcgis.com/en/pro-app/arcpy/metadata/metadata-class.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Metadata—Metadata module | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
aprx &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ArcGISProject&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"CURRENT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
current_map &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; aprx&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;activeMap
map_metadata &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; current_map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;metadata
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;map_metadata&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;title&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;map_metadata&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;description&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;whether python window or otherwise, the example gets the map specified whether it is an active map or&amp;nbsp; from a list of maps called "Map"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your case,&amp;nbsp;may be you need&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt;current_map = aprx.listMaps("Map")[0]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt;map_metadata = current_map.metadata&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;print (str(map_metadata.isReadOnly))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 17:03:46 GMT</pubDate>
    <dc:creator>DanPatterson</dc:creator>
    <dc:date>2021-12-11T17:03:46Z</dc:date>
    <item>
      <title>Change metadata of my map using a custom script tool in ArcGIS Pro</title>
      <link>https://community.esri.com/t5/python-questions/change-metadata-of-my-map-using-a-custom-script/m-p/367500#M28999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everybody,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got a question about updating metadata in ArcGIS pro using a custom script tool (arcpy metadata module).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Specifically, I want to update metadata of my map using a custom script tool, and here is my problem&amp;nbsp;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1-The metadata of the map is read only when I use the script tool.&lt;/P&gt;&lt;P&gt;In my script, if I launch the following command&amp;nbsp;:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;aprx = arcpy.mp.ArcGISProject("CURRENT")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;current_map = aprx.listMaps("Map")[0]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;map_metadata = current_map.metadata&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;arcpy.AddMessage (str(map_metadata.isReadOnly))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color: #00ff00;"&gt;output&amp;nbsp;: True&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;It appears that the map metadata is read only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2-What’s even weirder is that if I launch the same command from the Python window of ArcGIS PRO, the map metadata is not read only&amp;nbsp;:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;aprx = arcpy.mp.ArcGISProject("CURRENT")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;current_map = aprx.listMaps("Map")[0]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;map_metadata = current_map.metadata&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;print (str(map_metadata.isReadOnly))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color: #00ff00;"&gt;output&amp;nbsp;: False&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;It appears that the map metadata is not read only.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I update my metadata using a toolbox&amp;nbsp;? Ideally, I want to make the map metadata as not read only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2020 22:14:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-metadata-of-my-map-using-a-custom-script/m-p/367500#M28999</guid>
      <dc:creator>KarimD</dc:creator>
      <dc:date>2020-07-06T22:14:15Z</dc:date>
    </item>
    <item>
      <title>Re: Change metadata of my map using a custom script tool in ArcGIS Pro</title>
      <link>https://community.esri.com/t5/python-questions/change-metadata-of-my-map-using-a-custom-script/m-p/367501#M29000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/arcpy/metadata/metadata-class.htm" title="https://pro.arcgis.com/en/pro-app/arcpy/metadata/metadata-class.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Metadata—Metadata module | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
aprx &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mp&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ArcGISProject&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"CURRENT"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
current_map &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; aprx&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;activeMap
map_metadata &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; current_map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;metadata
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;map_metadata&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;title&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;map_metadata&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;description&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;whether python window or otherwise, the example gets the map specified whether it is an active map or&amp;nbsp; from a list of maps called "Map"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your case,&amp;nbsp;may be you need&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt;current_map = aprx.listMaps("Map")[0]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt;map_metadata = current_map.metadata&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="background-color: #ffffff; border: 0px;"&gt;print (str(map_metadata.isReadOnly))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 17:03:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-metadata-of-my-map-using-a-custom-script/m-p/367501#M29000</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-12-11T17:03:46Z</dc:date>
    </item>
    <item>
      <title>Re: Change metadata of my map using a custom script tool in ArcGIS Pro</title>
      <link>https://community.esri.com/t5/python-questions/change-metadata-of-my-map-using-a-custom-script/m-p/367502#M29001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/405782"&gt;Dan Patterson&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thank you for your reply.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;«&amp;nbsp;whether python window or otherwise&amp;nbsp;» : well...in my machine, getting the map metadatas through the python window enables me to edit the map metadatas. Whereas getting the map metadatas through my custom script tool prevents me from editing the map metadatas.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Here are my theories:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;There is some option I am not aware of that enables editing map metadatas when using a custom script tool (basically arcpy);&lt;/LI&gt;&lt;LI&gt;There is a bug in ArcGIS Pro, and I need to submit it. The bug is that, during scripting, the map metadatas are not readonly when using the python window, but they become readonly when using a custom script tool.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I&amp;nbsp;point to the fact that I need to change the map metadatas (not the layers, not the layout, not the feature classes...). The way you do that for each component seems to be very specific. What seems to be working for the feature layers is not necessarily working for the map.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know if you know how to change the map metadatas using a custom script tool ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2020 23:25:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-metadata-of-my-map-using-a-custom-script/m-p/367502#M29001</guid>
      <dc:creator>KarimD</dc:creator>
      <dc:date>2020-07-06T23:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: Change metadata of my map using a custom script tool in ArcGIS Pro</title>
      <link>https://community.esri.com/t5/python-questions/change-metadata-of-my-map-using-a-custom-script/m-p/367503#M29002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can check the current list of publicly listed bugs here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.esri.com/en/Search-Results#search?q=map%20metadata%20arcgis%20pro&amp;amp;content-type=Bugs"&gt;https://support.esri.com/en/Search-Results#search?q=map%20metadata%20arcgis%20pro&amp;amp;content-type=Bugs&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you think it is a bug, then you can file a case with Tech Support, or if you think there is a need for clarification in the help documentation, you can report it on the help page for the page you are using.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jul 2020 23:36:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-metadata-of-my-map-using-a-custom-script/m-p/367503#M29002</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2020-07-06T23:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: Change metadata of my map using a custom script tool in ArcGIS Pro</title>
      <link>https://community.esri.com/t5/python-questions/change-metadata-of-my-map-using-a-custom-script/m-p/367504#M29003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/405782"&gt;Dan Patterson&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There was a mistake in my original question (it has been edited). I obviously got the the map metadata object before printing it&amp;nbsp;&lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Still, my problem remains: why does the value of the "isReadOnly" attribute is different depending on whether I use the Python window or the custom script tool ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jul 2020 07:26:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-metadata-of-my-map-using-a-custom-script/m-p/367504#M29003</guid>
      <dc:creator>KarimD</dc:creator>
      <dc:date>2020-07-07T07:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: Change metadata of my map using a custom script tool in ArcGIS Pro</title>
      <link>https://community.esri.com/t5/python-questions/change-metadata-of-my-map-using-a-custom-script/m-p/1200236#M65235</link>
      <description>&lt;P&gt;I have the same issue. I'm making a task tool, driven by py tools. The metadata object remains read only. I can make my own metadata object and populate it, but can't copy and save it in the map metadata object. The Map Metadata object remains read only. This happens when using a script tool in ArcGIS Pro, or when running py via idle with ArcGIS Pro closed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;m = aprx.activeMap
m.name = Title  #set the map elements name to the same as the title
# create empty metadata object and populate it with our varibles
new_md = md.Metadata()
new_md.title = 'Title'
new_md.tags = 'Tag1, Tag2'
new_md.summary = 'Summary'
new_md.description = 'Description'
new_md.credits = 'My Credits'
activemap_metadata = md.Metadata(m) #the metadata object for the active map
if activemap_metadata.isReadOnly:
    arcpy.AddMessage("the metadata object for the active map is read only")
else:
    activemap_metadata.copy(new_md)
    activemap_metadata.save()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Aug 2022 01:36:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-metadata-of-my-map-using-a-custom-script/m-p/1200236#M65235</guid>
      <dc:creator>JosephMcGehan</dc:creator>
      <dc:date>2022-08-08T01:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: Change metadata of my map using a custom script tool in ArcGIS Pro</title>
      <link>https://community.esri.com/t5/python-questions/change-metadata-of-my-map-using-a-custom-script/m-p/1200687#M65248</link>
      <description>&lt;P&gt;Solved:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;        m.name = ShortTitle
        map_metadata = m.metadata
        map_metadata.title = Title
        map_metadata.summary = Summary       
        map_metadata.description = Description
        map_metadata.tags = Tag
        map_metadata.credits = Credits
        map_metadata.accessConstraints = Terms
        map_metadata.save()&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 09 Aug 2022 05:38:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/change-metadata-of-my-map-using-a-custom-script/m-p/1200687#M65248</guid>
      <dc:creator>JosephMcGehan</dc:creator>
      <dc:date>2022-08-09T05:38:28Z</dc:date>
    </item>
  </channel>
</rss>

