JMP Pro 16.1
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. 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.
If I run this code:
dtTemp = New Table("Temp");
dtTemp << Save("");
The Save As dialog pops up in whatever directory I last saved in. If I try to force the directory like this:
dtTemp2 = New Table("Temp2");
dtTemp2 << Save As("$Documents\");
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.
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. I tried a few options, but none of these seems to be the right one.
path1 = Get Default Directory();
path2 = Get Current Directory();
path3 = Get File Search Path();
Show( path1, path2, path3);
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.
What I want is something like:
dtTemp = New Table("Temp");
Set Data Table Save Path ("$DESKTOP\MyDestination");
dtTemp << Save("");
Any ideas?