<?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: Finding a relative path in a network in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Finding-a-relative-path-in-a-network/m-p/16262#M14832</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you saying that Get Default Directory does not return the location of the script file?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Usually paths are relative to the location of the script so if the table is in the same directory you can write&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Open("test table.jmp")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or if you have a folder containing scripts and another containing data tables (both at the same level) you can write&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Open("../Data Tables Folder/test table.jmp")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have a single script or are you using include files?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 12 Jan 2016 12:55:13 GMT</pubDate>
    <dc:creator>David_Burnham</dc:creator>
    <dc:date>2016-01-12T12:55:13Z</dc:date>
    <item>
      <title>Finding a relative path in a network</title>
      <link>https://community.jmp.com/t5/Discussions/Finding-a-relative-path-in-a-network/m-p/16260#M14830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;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:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TempTable = "K:\...\TableTemplate.jmp";&lt;/P&gt;&lt;P&gt;open (TempTable);&lt;/P&gt;&lt;P&gt;&lt;EM&gt;(this setup works)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;the data table is located in the same directory as the script, therefore I would reason that I should be able to use:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;TempTable ="..\[folder]\TableTemplate.jmp"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;open (TempTable);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However this doesnt work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could anyone please give me suggestions on how to locate the folder where the script (not the table) is stored on the server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Anders&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jan 2016 11:24:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Finding-a-relative-path-in-a-network/m-p/16260#M14830</guid>
      <dc:creator>anders_bankefor</dc:creator>
      <dc:date>2016-01-12T11:24:39Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a relative path in a network</title>
      <link>https://community.jmp.com/t5/Discussions/Finding-a-relative-path-in-a-network/m-p/16261#M14831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would just like to add that I've tried to use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;path=get default directory()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;without success&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jan 2016 11:55:32 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Finding-a-relative-path-in-a-network/m-p/16261#M14831</guid>
      <dc:creator>anders_bankefor</dc:creator>
      <dc:date>2016-01-12T11:55:32Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a relative path in a network</title>
      <link>https://community.jmp.com/t5/Discussions/Finding-a-relative-path-in-a-network/m-p/16262#M14832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you saying that Get Default Directory does not return the location of the script file?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Usually paths are relative to the location of the script so if the table is in the same directory you can write&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Open("test table.jmp")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or if you have a folder containing scripts and another containing data tables (both at the same level) you can write&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Open("../Data Tables Folder/test table.jmp")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have a single script or are you using include files?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jan 2016 12:55:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Finding-a-relative-path-in-a-network/m-p/16262#M14832</guid>
      <dc:creator>David_Burnham</dc:creator>
      <dc:date>2016-01-12T12:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a relative path in a network</title>
      <link>https://community.jmp.com/t5/Discussions/Finding-a-relative-path-in-a-network/m-p/16263#M14833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the process for the user, to run this script?&amp;nbsp; 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?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I placed a simple script and a data table into the same directory, and then opened them from both under the JMP File==&amp;gt;Open and the Windows Explorer window, and have not had an issue when I use the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;//!&lt;/P&gt;&lt;P&gt;Names Default to Here(1);&lt;/P&gt;&lt;P&gt;path=get default directory();&lt;/P&gt;&lt;P&gt;dt=open(path||"couples golf members.jmp");&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jan 2016 13:08:42 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Finding-a-relative-path-in-a-network/m-p/16263#M14833</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2016-01-12T13:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: Finding a relative path in a network</title>
      <link>https://community.jmp.com/t5/Discussions/Finding-a-relative-path-in-a-network/m-p/16264#M14834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To avoid different disk drive mappings, you could use the long UNC-style name.&amp;nbsp; Something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New';"&gt;\\disk.rd.com\folder1\folder2\folder3\TableTemplate.jmp&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternatively I would recommend creating an addin.&amp;nbsp; Suppose your addin is called &lt;STRONG&gt;com.cmpny.dept.myapp&lt;/STRONG&gt;.&amp;nbsp; The syntax would be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt;TempTable &lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: navy;"&gt;=&lt;/SPAN&gt; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: purple;"&gt;"$ADDIN_HOME(com.cmpny.dept.myapp)\TableTemplate.jmp"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: #0000dd;"&gt;open&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black;"&gt; &lt;STRONG&gt;(&lt;/STRONG&gt;TempTable&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: navy;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jan 2016 19:55:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Finding-a-relative-path-in-a-network/m-p/16264#M14834</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2016-01-12T19:55:15Z</dc:date>
    </item>
  </channel>
</rss>

