<?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: how to add user input of file path in Python Add-in script? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-add-user-input-of-file-path-in-python-add/m-p/90335#M7040</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 31 Jul 2015 01:41:48 GMT</pubDate>
    <dc:creator>SiyangTeo</dc:creator>
    <dc:date>2015-07-31T01:41:48Z</dc:date>
    <item>
      <title>how to add user input of file path in Python Add-in script?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-add-user-input-of-file-path-in-python-add/m-p/90333#M7038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I made a simple toolbar of 2 buttons to export the map into JPEG and PDF using Python Add-in wizard.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I wanted to improve the script such that when I click the button, it will prompt a window to select the location to place the file, and also input the file name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does any know how to do it? The present script is pasted below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------&lt;/P&gt;&lt;P&gt;import arcpy&lt;/P&gt;&lt;P&gt;import pythonaddins&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class export2_jpg(object):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; """Implementation for export2_jpg_addin.button (Button)"""&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; def __init__(self):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.enabled = True&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.checked = False&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; def onClick(self):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd = arcpy.mapping.MapDocument('current')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.mapping.ExportToJPEG(mxd,r'C:\Users\xx\Desktop\output.jpg, resolution=300')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class export2_pdf(object):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; """Implementation for export2_pdf_addin.button (Button)"""&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; def __init__(self):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.enabled = True&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.checked = False&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; def onClick(self):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mxd = arcpy.mapping.MapDocument('current')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.mapping.ExportToPDF(mxd,r'C:\Users\xx\Desktop\output.pdf')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pass&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2015 14:47:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-add-user-input-of-file-path-in-python-add/m-p/90333#M7038</guid>
      <dc:creator>SiyangTeo</dc:creator>
      <dc:date>2015-07-30T14:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: how to add user input of file path in Python Add-in script?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-add-user-input-of-file-path-in-python-add/m-p/90334#M7039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have a look at &lt;A href="https://desktop.arcgis.com/en/desktop/latest/guide-books/python-addins/the-pythonaddins-module.htm"&gt;pythonaddins.SaveDialog&lt;/A&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2015 20:03:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-add-user-input-of-file-path-in-python-add/m-p/90334#M7039</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2015-07-30T20:03:24Z</dc:date>
    </item>
    <item>
      <title>Re: how to add user input of file path in Python Add-in script?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-add-user-input-of-file-path-in-python-add/m-p/90335#M7040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2015 01:41:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-add-user-input-of-file-path-in-python-add/m-p/90335#M7040</guid>
      <dc:creator>SiyangTeo</dc:creator>
      <dc:date>2015-07-31T01:41:48Z</dc:date>
    </item>
  </channel>
</rss>

