<?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: Script Tool Return Value in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/script-tool-return-value/m-p/63136#M2240</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can set up an output parameter of type string and then use SetParameterAsText to populate the value at the end of your script.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Aug 2011 16:52:03 GMT</pubDate>
    <dc:creator>JasonScheirer</dc:creator>
    <dc:date>2011-08-11T16:52:03Z</dc:date>
    <item>
      <title>Script Tool Return Value</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/script-tool-return-value/m-p/63134#M2238</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to set up a model to do a task that I do every month.&amp;nbsp; Part of that model is a stand-alone python script that creates a file name with the date tagged on to the end of it.&amp;nbsp; How do I write my script so that it returns this string and I can use it as input for another geoprocessing tool?&amp;nbsp; I have searched the forums and help, but can't find any examples of this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help is much appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Aug 2011 15:59:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/script-tool-return-value/m-p/63134#M2238</guid>
      <dc:creator>JeffWard</dc:creator>
      <dc:date>2011-08-11T15:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: Script Tool Return Value</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/script-tool-return-value/m-p/63135#M2239</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Are you trying to use the current date or a date that you want to set?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If so, try importing datetime, create the date and then pass it to a string variable. From there, build your file name and concatenate your string date variable where you want it. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;x = str(yourdatevariable)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here are some good examples on how datetime works.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.saltycrane.com/blog/2008/06/how-to-get-current-date-and-time-in/"&gt;http://www.saltycrane.com/blog/2008/06/how-to-get-current-date-and-time-in/&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Aug 2011 16:25:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/script-tool-return-value/m-p/63135#M2239</guid>
      <dc:creator>MikeMacRae</dc:creator>
      <dc:date>2011-08-11T16:25:51Z</dc:date>
    </item>
    <item>
      <title>Re: Script Tool Return Value</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/script-tool-return-value/m-p/63136#M2240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can set up an output parameter of type string and then use SetParameterAsText to populate the value at the end of your script.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Aug 2011 16:52:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/script-tool-return-value/m-p/63136#M2240</guid>
      <dc:creator>JasonScheirer</dc:creator>
      <dc:date>2011-08-11T16:52:03Z</dc:date>
    </item>
    <item>
      <title>Re: Script Tool Return Value</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/script-tool-return-value/m-p/63137#M2241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the quick responses.&amp;nbsp; After looking into the output parameter, I have added my script to the model as a script tool and created an output parameter as a string type.&amp;nbsp; The file name is hard coded into the script, so I don't have any parameters in the script.&amp;nbsp; Do I need to create one for the setParameterAsText?&amp;nbsp; Can you point me to some examples of what the a script with an output parameter looks like and I can figure out how to plug it into the model?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again for the quick replies.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Aug 2011 21:25:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/script-tool-return-value/m-p/63137#M2241</guid>
      <dc:creator>JeffWard</dc:creator>
      <dc:date>2011-08-11T21:25:38Z</dc:date>
    </item>
    <item>
      <title>Re: Script Tool Return Value</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/script-tool-return-value/m-p/63138#M2242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;See &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Setting_script_tool_parameters/00150000000n000000/"&gt;Setting script tool parameters&lt;/A&gt;&lt;SPAN&gt;.&amp;nbsp; It appears you want a single derived output parameter, so pay particular attention to the write-ups about derived output parameters.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Aug 2011 23:15:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/script-tool-return-value/m-p/63138#M2242</guid>
      <dc:creator>DaleHoneycutt</dc:creator>
      <dc:date>2011-08-11T23:15:53Z</dc:date>
    </item>
    <item>
      <title>Re: Script Tool Return Value</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/script-tool-return-value/m-p/63139#M2243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks everyone for your help.&amp;nbsp; Thanks for that link Dale, that is what I needed to get what I was calling a return value.&amp;nbsp; I created a derived output string parameter for my script tool and added this line to the end of my script: arcpy.SetParameterAsText(0, fileName).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Aug 2011 16:02:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/script-tool-return-value/m-p/63139#M2243</guid>
      <dc:creator>JeffWard</dc:creator>
      <dc:date>2011-08-17T16:02:17Z</dc:date>
    </item>
  </channel>
</rss>

