<?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 How to include script using relative path? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-include-script-using-relative-path/m-p/494940#M73387</link>
    <description>&lt;P&gt;I have two scripts, main.jsl and dosomething.jsl that are next to each other in the same folder.&lt;/P&gt;&lt;P&gt;Main script has this in it:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;relativePath = "./";&lt;BR /&gt;absolutePath = "c:\Users\myUser\Scripts\";&lt;BR /&gt;dosomething = Expr(
Include( relativePath || "dosomething.jsl" )
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This &lt;EM&gt;dosomething&lt;/EM&gt; does something all over the script, it's very handy to edit dosomething.jsl WHILE still running the main script.&lt;/P&gt;&lt;P&gt;So, when I do that using &lt;EM&gt;relativePath&lt;/EM&gt; as written above - JMP crushes. But works fine when using &lt;EM&gt;absolutePath&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, I don't want to use absolute path. How can I use relative path in Include statement?&lt;/P&gt;&lt;P&gt;For instance, this works fine for Logo.png that lies next to these two scripts:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Picture Box( Open( "./Logo.png", png ) )&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If relative paths not working with Include, is there any way to access the absolute path for the currently running script?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jun 2023 17:00:12 GMT</pubDate>
    <dc:creator>miguello</dc:creator>
    <dc:date>2023-06-09T17:00:12Z</dc:date>
    <item>
      <title>How to include script using relative path?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-include-script-using-relative-path/m-p/494940#M73387</link>
      <description>&lt;P&gt;I have two scripts, main.jsl and dosomething.jsl that are next to each other in the same folder.&lt;/P&gt;&lt;P&gt;Main script has this in it:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;relativePath = "./";&lt;BR /&gt;absolutePath = "c:\Users\myUser\Scripts\";&lt;BR /&gt;dosomething = Expr(
Include( relativePath || "dosomething.jsl" )
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This &lt;EM&gt;dosomething&lt;/EM&gt; does something all over the script, it's very handy to edit dosomething.jsl WHILE still running the main script.&lt;/P&gt;&lt;P&gt;So, when I do that using &lt;EM&gt;relativePath&lt;/EM&gt; as written above - JMP crushes. But works fine when using &lt;EM&gt;absolutePath&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, I don't want to use absolute path. How can I use relative path in Include statement?&lt;/P&gt;&lt;P&gt;For instance, this works fine for Logo.png that lies next to these two scripts:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Picture Box( Open( "./Logo.png", png ) )&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If relative paths not working with Include, is there any way to access the absolute path for the currently running script?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 17:00:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-include-script-using-relative-path/m-p/494940#M73387</guid>
      <dc:creator>miguello</dc:creator>
      <dc:date>2023-06-09T17:00:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to include script using relative path?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-include-script-using-relative-path/m-p/494959#M73388</link>
      <description>&lt;P&gt;And again, formulating and writing down the question gave me an idea where to look for the answer.&lt;/P&gt;&lt;P&gt;So this works:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;relativePath = Get Default Directory();
absolutePath = "c:\Users\myUser\Scripts\";&lt;BR /&gt;&lt;BR /&gt;dosomething = Expr(
Include( relativePath || "dosomething.jsl" )
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 28 May 2022 01:03:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-include-script-using-relative-path/m-p/494959#M73388</guid>
      <dc:creator>miguello</dc:creator>
      <dc:date>2022-05-28T01:03:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to include script using relative path?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-include-script-using-relative-path/m-p/494992#M73389</link>
      <description>&lt;P&gt;Other function which might be helpful is &lt;A href="https://www.jmp.com/support/help/en/16.2/#page/jmp/file-functions.shtml?os=win&amp;amp;source=application#ww4945280" target="_blank" rel="noopener"&gt;Convert File Path()&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 28 May 2022 07:05:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-include-script-using-relative-path/m-p/494992#M73389</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-05-28T07:05:06Z</dc:date>
    </item>
  </channel>
</rss>

