<?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 the starting directory for the &amp;quot;Save As&amp;quot; pop-up dialog with JSL in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Setting-the-starting-directory-for-the-quot-Save-As-quot-pop-up/m-p/513258#M74076</link>
    <description>&lt;P&gt;JMP Pro 16.1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to write script that brings up a "Save As" dialog box when a button is clicked, but I want to control what directory it starts in.&amp;nbsp; I do not want to save the table with its current name; I want to give the user a chance to change the name before saving.&lt;/P&gt;&lt;P&gt;If I run this code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dtTemp = New Table("Temp");
dtTemp &amp;lt;&amp;lt; Save("");&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Save As dialog pops up in whatever directory I last saved in.&amp;nbsp; If I try to force the directory like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dtTemp2 = New Table("Temp2");
dtTemp2 &amp;lt;&amp;lt; Save As("$Documents\");&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;then my Temp2 table gets renamed to ".jmp" and saved in the Documents folder which is no good. I need that dialog that lets the user set the name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Somewhere there is a variable where JMP or the OS is saving the last directory/path where a file was saved, I'd like to overwrite this, but I can't even find it.&amp;nbsp; I tried a few options, but none of these seems to be the right one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;path1 = Get Default Directory();
path2 = Get Current Directory();
path3 = Get File Search Path();

Show( path1, path2, path3);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It's worth noting that it seems the "last save directory" is stored separately for scripts and data tables which makes me think what I'm looking for is saved somehow within JMP, not the OS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want is something like:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dtTemp = New Table("Temp");
Set Data Table Save Path ("$DESKTOP\MyDestination");
dtTemp &amp;lt;&amp;lt; Save("");&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jun 2023 17:02:19 GMT</pubDate>
    <dc:creator>TomF</dc:creator>
    <dc:date>2023-06-09T17:02:19Z</dc:date>
    <item>
      <title>Setting the starting directory for the "Save As" pop-up dialog with JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Setting-the-starting-directory-for-the-quot-Save-As-quot-pop-up/m-p/513258#M74076</link>
      <description>&lt;P&gt;JMP Pro 16.1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to write script that brings up a "Save As" dialog box when a button is clicked, but I want to control what directory it starts in.&amp;nbsp; I do not want to save the table with its current name; I want to give the user a chance to change the name before saving.&lt;/P&gt;&lt;P&gt;If I run this code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dtTemp = New Table("Temp");
dtTemp &amp;lt;&amp;lt; Save("");&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;CODE class=" language-jsl"&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Save As dialog pops up in whatever directory I last saved in.&amp;nbsp; If I try to force the directory like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dtTemp2 = New Table("Temp2");
dtTemp2 &amp;lt;&amp;lt; Save As("$Documents\");&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;then my Temp2 table gets renamed to ".jmp" and saved in the Documents folder which is no good. I need that dialog that lets the user set the name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Somewhere there is a variable where JMP or the OS is saving the last directory/path where a file was saved, I'd like to overwrite this, but I can't even find it.&amp;nbsp; I tried a few options, but none of these seems to be the right one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;path1 = Get Default Directory();
path2 = Get Current Directory();
path3 = Get File Search Path();

Show( path1, path2, path3);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It's worth noting that it seems the "last save directory" is stored separately for scripts and data tables which makes me think what I'm looking for is saved somehow within JMP, not the OS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I want is something like:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dtTemp = New Table("Temp");
Set Data Table Save Path ("$DESKTOP\MyDestination");
dtTemp &amp;lt;&amp;lt; Save("");&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 17:02:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Setting-the-starting-directory-for-the-quot-Save-As-quot-pop-up/m-p/513258#M74076</guid>
      <dc:creator>TomF</dc:creator>
      <dc:date>2023-06-09T17:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: Setting the starting directory for the "Save As" pop-up dialog with JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Setting-the-starting-directory-for-the-quot-Save-As-quot-pop-up/m-p/513753#M74116</link>
      <description>&lt;P&gt;You could get the filename first using Pick File, and then save it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names default to here(1);

fn = pick file("Save your file", "$DOCUMENTS", {"JMP Files|jmp;jsl;jrn", "All Files|*"}, 1, 1, "Default Filename.jmp" );

dt &amp;lt;&amp;lt; Save (fn);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Jun 2022 16:08:46 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Setting-the-starting-directory-for-the-quot-Save-As-quot-pop-up/m-p/513753#M74116</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2022-06-24T16:08:46Z</dc:date>
    </item>
    <item>
      <title>Re: Setting the starting directory for the "Save As" pop-up dialog with JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Setting-the-starting-directory-for-the-quot-Save-As-quot-pop-up/m-p/514102#M74136</link>
      <description>&lt;P&gt;Didn't know that you could change Pick File's button text from Open to Save by changing saveFlag to 1 (have never tried it).&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jthi_0-1656141886799.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/43562i4E571BCA983C9241/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jthi_0-1656141886799.png" alt="jthi_0-1656141886799.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;With saveFlag = 0 button will be named Open and with saveFlag = 1 it will be named Save. It won't save the file (it will just return path) so you still have to save it like &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/6657"&gt;@ih&lt;/a&gt; demonstrated (also remember to check that the returned path isn't empty).&lt;/P&gt;</description>
      <pubDate>Sat, 25 Jun 2022 07:28:33 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Setting-the-starting-directory-for-the-quot-Save-As-quot-pop-up/m-p/514102#M74136</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-06-25T07:28:33Z</dc:date>
    </item>
  </channel>
</rss>

