<?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: error in setting text in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/error-in-setting-text/m-p/674993#M52234</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ok, I figured out that I need to run the script through a script tool, which allows me to enter the needed arguments. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your reply. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;S&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Dec 2011 19:27:02 GMT</pubDate>
    <dc:creator>SamanthaEdwards</dc:creator>
    <dc:date>2011-12-29T19:27:02Z</dc:date>
    <item>
      <title>error in setting text</title>
      <link>https://community.esri.com/t5/python-questions/error-in-setting-text/m-p/674991#M52232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to generate a map book with the following code that I downloaded but I keep getting an errror: &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;RuntimeError: TextElementObject: Error in setting text &lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
#Read values from input dialog
title = arcpy.GetParameterAsText(0)
organization = arcpy.GetParameterAsText(1)

arcpy.AddMessage("&amp;nbsp;&amp;nbsp;&amp;nbsp; Updating Title Page ...")
titleMXD = arcpy.mapping.MapDocument("path\county_map_book\MapBook_TitlePage.mxd")
titleText = arcpy.mapping.ListLayoutElements(titleMXD, "TEXT_ELEMENT", "Title")[0]
titleText.text = title
arcpy.mapping.ExportToPDF(titleMXD,"path\county_map_book\Output\1_TitlePage.pdf")
del titleMXD&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I know it has to do with titleText.text = title, I'm just not sure how to fix it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your help,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;S&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Dec 2011 13:11:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-in-setting-text/m-p/674991#M52232</guid>
      <dc:creator>SamanthaEdwards</dc:creator>
      <dc:date>2011-12-29T13:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: error in setting text</title>
      <link>https://community.esri.com/t5/python-questions/error-in-setting-text/m-p/674992#M52233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This snippet of code works. When you run the script in say PythonWin, are you inserting text into the arugment section of the "Run Script" dialog? I got this error only when I didn't give an arugment. The text in the argument would then be assigned to the variable &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;title&lt;/SPAN&gt;&lt;SPAN&gt; since you have the GetParameterAsText option setup here. This would then get propagated down to where you want to change the title's text, &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;titleText.text = title&lt;/SPAN&gt;&lt;SPAN&gt;. You can also hard code what you want the title variable to be until you are ready to make this into a script tool.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Dec 2011 17:37:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-in-setting-text/m-p/674992#M52233</guid>
      <dc:creator>StephanieWendel</dc:creator>
      <dc:date>2011-12-29T17:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: error in setting text</title>
      <link>https://community.esri.com/t5/python-questions/error-in-setting-text/m-p/674993#M52234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ok, I figured out that I need to run the script through a script tool, which allows me to enter the needed arguments. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your reply. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;S&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Dec 2011 19:27:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-in-setting-text/m-p/674993#M52234</guid>
      <dc:creator>SamanthaEdwards</dc:creator>
      <dc:date>2011-12-29T19:27:02Z</dc:date>
    </item>
  </channel>
</rss>

