I would like JMP to pick up a "template-table" from the same directory that the script is located. This pathway may vary depending on user due to network setup (for example for me the disk is named K but for other users it might be named L or N). I've managed to use the following "fixed" link:
TempTable = "K:\...\TableTemplate.jmp";
(this setup works)
the data table is located in the same directory as the script, therefore I would reason that I should be able to use:
However this doesnt work.
Could anyone please give me suggestions on how to locate the folder where the script (not the table) is stored on the server.
Are you saying that Get Default Directory does not return the location of the script file?
Usually paths are relative to the location of the script so if the table is in the same directory you can write
Or if you have a folder containing scripts and another containing data tables (both at the same level) you can write
Open("../Data Tables Folder/test table.jmp")
Do you have a single script or are you using include files?
What is the process for the user, to run this script? Will they be opening up the script and then manually running the script by clicking on the "Run Script" icon, or will the script automatically run when opened?
I placed a simple script and a data table into the same directory, and then opened them from both under the JMP File==>Open and the Windows Explorer window, and have not had an issue when I use the following code:
Names Default to Here(1);
path=get default directory();
dt=open(path||"couples golf members.jmp");
To avoid different disk drive mappings, you could use the long UNC-style name. Something like:
Alternatively I would recommend creating an addin. Suppose your addin is called com.cmpny.dept.myapp. The syntax would be:
TempTable = "$ADDIN_HOME(com.cmpny.dept.myapp)\TableTemplate.jmp";