<?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 Setting Map Document Properties in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/setting-map-document-properties/m-p/78194#M6303</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to update Map Document Properties, but am struggling with the syntax for a carriage return/ line feed in the description property.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I use the Python window I can retrieve the description property and it looks something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;gt;&amp;gt;&amp;gt; mxd.description
u'Test Line 1\r\nTest Line 2'
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I set the description property with the Python window with the following string:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;gt;&amp;gt;&amp;gt; mxd.description='New Line 1\r\nNew Line 2'&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It works as expected.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, if I try to specify that same string via a script parameter it adds an extra '\' and looks like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;u'Test Line 1\\r\\nTest Line 2'&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas/suggestions would be greatly appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Warren M&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 Aug 2011 17:40:23 GMT</pubDate>
    <dc:creator>WarrenMedernach</dc:creator>
    <dc:date>2011-08-30T17:40:23Z</dc:date>
    <item>
      <title>Setting Map Document Properties</title>
      <link>https://community.esri.com/t5/python-questions/setting-map-document-properties/m-p/78194#M6303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to update Map Document Properties, but am struggling with the syntax for a carriage return/ line feed in the description property.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I use the Python window I can retrieve the description property and it looks something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;gt;&amp;gt;&amp;gt; mxd.description
u'Test Line 1\r\nTest Line 2'
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I set the description property with the Python window with the following string:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;gt;&amp;gt;&amp;gt; mxd.description='New Line 1\r\nNew Line 2'&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It works as expected.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, if I try to specify that same string via a script parameter it adds an extra '\' and looks like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;u'Test Line 1\\r\\nTest Line 2'&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas/suggestions would be greatly appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Warren M&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Aug 2011 17:40:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/setting-map-document-properties/m-p/78194#M6303</guid>
      <dc:creator>WarrenMedernach</dc:creator>
      <dc:date>2011-08-30T17:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Map Document Properties</title>
      <link>https://community.esri.com/t5/python-questions/setting-map-document-properties/m-p/78195#M6304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Should work&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;mxd.description= &lt;STRONG&gt;r&lt;/STRONG&gt;'New Line 1\r\nNew Line 2'&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Aug 2011 17:46:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/setting-map-document-properties/m-p/78195#M6304</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2011-08-30T17:46:51Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Map Document Properties</title>
      <link>https://community.esri.com/t5/python-questions/setting-map-document-properties/m-p/78196#M6305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Mathew,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, but like I mentioned, everything works when I execute it from the Python window.&amp;nbsp; The problem is when I try to use an input parameter like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;IMG src="http://forums.arcgis.com/attachment.php?attachmentid=8636&amp;amp;stc=1&amp;amp;d=1314733738" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Aug 2011 18:49:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/setting-map-document-properties/m-p/78196#M6305</guid>
      <dc:creator>WarrenMedernach</dc:creator>
      <dc:date>2011-08-30T18:49:43Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Map Document Properties</title>
      <link>https://community.esri.com/t5/python-questions/setting-map-document-properties/m-p/78197#M6306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ahh, sorry for my misunderstanding.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The only solution I can see is to have a parameter for each line you want to add, workable if you have a fixed number of lines to add each time.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Aug 2011 19:06:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/setting-map-document-properties/m-p/78197#M6306</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2011-08-30T19:06:24Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Map Document Properties</title>
      <link>https://community.esri.com/t5/python-questions/setting-map-document-properties/m-p/78198#M6307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Actually now that I think about it, you can have some other character that you can split on and input those as variables surrounded by the returns, something like this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
desc = arcpy.GetParameter(0)
desc = desc.split("#")
mxd.description = desc[0]+"\r\n"+desc[1]
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 23:00:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/setting-map-document-properties/m-p/78198#M6307</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2021-12-10T23:00:36Z</dc:date>
    </item>
  </channel>
</rss>

