<?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: How to call scripts and functions from inside a folder? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-call-scripts-and-functions-from-inside-a-folder/m-p/635704#M83386</link>
    <description>&lt;OL&gt;
&lt;LI&gt;Read the documentation on Encrypting Scripts in the Scripting Guide&lt;/LI&gt;
&lt;LI&gt;Here is an example.&amp;nbsp; Note, the top part of the script saves a couple of already encrypted scripts.&amp;nbsp; Only the bottom of the script is what you would use to access saved encrypted scripts.&lt;/LI&gt;
&lt;/OL&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);


// Create some saved encrypted scripts

// Below is an encrypted script that simply does a
// oneway()Oneway( Y( :height ), X( :sex ) )
encrypt =
"//-e12.1
0,
200,4182eJwNy9kBwiAMANB9XIFwlENKE0KhoMD+g+j7f6z01jbXDE3LJBaeCTjQ15Own9a6fQoXi7LcDp5qFrvE96Rneht6PKMy28XR
/336IaXjqrRfBlcsB4SazIgNtDSCujmYUsRq8Jozgmp7HOwaXej6mXfdiMLfaTM2yic22QMpD47KhMnfakSI75AsitcPuvg0Sg==
,0,";
// Save to a file
save text file("$TEMP/encript1.jsl",encrypt);

// Here is a second encrypted script that is simply
// Distribution( Continuous Distribution( Column( :height ) ) )
anotherEncrypt = 
"//-e12.1
0,
224,4214eJwFwQkCwxAQAMD/9Auom+gu60zE/x/SGb5FBzdI3uv2eXW1FZf8JPN43VlFM1r2w+WbNuXU7A9M/X31V4EM5X6nEQJh8xPK
s6yuLeuWmcVN5KeK79TxUImohaaoWzK8cxUaVD9qZymQZFmNY+sp4k7UVwDGCcxeWyuG7rhTdnmy4o+WieaFBBXxIuQGprua2/mF
gakEBpHZN/sI7PMHIYc+CQ==
,0,";

// Save to a file
save text file("$TEMP/encript2.jsl",anotherEncrypt);

// Wait 10 seconds
wait(10);

// Here is the script that runs the 2 saved encrypted scripts

dt =
// Open Data Table: Big Class.jmp
// → Data Table( "Big Class" )
Open( "$SAMPLE_DATA/Big Class.jmp" );
include("$TEMP/encript1.jsl");
include("$TEMP/encript2.jsl");&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 25 May 2023 18:04:11 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2023-05-25T18:04:11Z</dc:date>
    <item>
      <title>How to call scripts and functions from inside a folder?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-call-scripts-and-functions-from-inside-a-folder/m-p/634977#M83312</link>
      <description>&lt;P&gt;I have several scripts and functions which are called by my main JSL script. They are all working and are in one single folder.&lt;/P&gt;&lt;P&gt;I want to keep all scripts and functions inside a &lt;FONT color="#333399"&gt;folder&lt;/FONT&gt; to have a layer of protection from unwanted modification while only having the main script outside. The main script will call the functions and files from this say &lt;FONT color="#333399"&gt;"myScripts" folder&lt;/FONT&gt;. How to implement this in JSL - could I please have an example?&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 16:10:37 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-call-scripts-and-functions-from-inside-a-folder/m-p/634977#M83312</guid>
      <dc:creator>Neo</dc:creator>
      <dc:date>2023-06-09T16:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to call scripts and functions from inside a folder?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-call-scripts-and-functions-from-inside-a-folder/m-p/634992#M83314</link>
      <description>&lt;P&gt;Hi Neo,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Will the include function work for you? Try this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Include("$SAMPLE_SCRIPTS/estimatingPi.jsl");&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;There are additional arguments. &amp;gt;&amp;gt;Parse Only will parse but not run script, &amp;gt;&amp;gt;Names Default to Here executes the script in its own name space.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2023 17:14:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-call-scripts-and-functions-from-inside-a-folder/m-p/634992#M83314</guid>
      <dc:creator>Jason_Wiggins</dc:creator>
      <dc:date>2023-05-24T17:14:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to call scripts and functions from inside a folder?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-call-scripts-and-functions-from-inside-a-folder/m-p/635091#M83329</link>
      <description>&lt;P&gt;You may want to look into encrypting the JSL files you do not want to have modified.&amp;nbsp; If they are encrypted, then JMP will not even display them in the log, thus keeping them secure.&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2023 19:05:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-call-scripts-and-functions-from-inside-a-folder/m-p/635091#M83329</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-05-24T19:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to call scripts and functions from inside a folder?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-call-scripts-and-functions-from-inside-a-folder/m-p/635530#M83370</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/13731"&gt;@Jason_Wiggins&lt;/a&gt;&amp;nbsp; Thanks. The issue I see here is when I share the parent folder (say zipped via email), depending on where the user places the unzipped parent folder (containing the main script and the other scripts inside myScripts folder), the path to parent folder changes which means I cannot hard code the path to myScripts folder in my main script. Am I missing something?&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2023 14:02:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-call-scripts-and-functions-from-inside-a-folder/m-p/635530#M83370</guid>
      <dc:creator>Neo</dc:creator>
      <dc:date>2023-05-25T14:02:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to call scripts and functions from inside a folder?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-call-scripts-and-functions-from-inside-a-folder/m-p/635531#M83371</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;Encrypting option sounds good. Could I have (/please point to) an example with one main script and two other scripts which the main script calls (with the these other two scripts encrypted)?&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2023 14:04:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-call-scripts-and-functions-from-inside-a-folder/m-p/635531#M83371</guid>
      <dc:creator>Neo</dc:creator>
      <dc:date>2023-05-25T14:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to call scripts and functions from inside a folder?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-call-scripts-and-functions-from-inside-a-folder/m-p/635554#M83375</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/28235"&gt;@Neo&lt;/a&gt; do you expect the user you are sharing your scripts with will run them or are they just for reference? If they primarily run the script, have you considered compiling the scripts into an &lt;A href="https://www.jmp.com/support/help/en/17.1/?os=win&amp;amp;source=application#page/jmp/compile-scripts-into-an-addin-using-addin-builder.shtml" target="_self"&gt;add-in&lt;/A&gt;? Add-in files are stored in an add-in folder that is consistent from user to user e.g.&amp;nbsp;&lt;SPAN&gt;Windows:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="filepath"&gt;C:\Users\&amp;lt;username&amp;gt;\AppData\Roaming\SAS\JMP\Addins\*.* .JMP recognizes the add-in directory regardless of who the user is. Include() works in add-ins and you can add additional files your script uses e.g. pictures.&amp;nbsp; The scripts and additional files are available to the user if they want to repurpose or review the code. There are ways to &lt;A href="https://www.jmp.com/support/help/en/17.1/?os=win&amp;amp;source=application#page/jmp/encrypt-and-decrypt-scripts.shtml" target="_self"&gt;encrypt&lt;/A&gt; if you don't want the user to have access to the code as &lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt; suggested.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 May 2023 14:44:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-call-scripts-and-functions-from-inside-a-folder/m-p/635554#M83375</guid>
      <dc:creator>Jason_Wiggins</dc:creator>
      <dc:date>2023-05-25T14:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to call scripts and functions from inside a folder?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-call-scripts-and-functions-from-inside-a-folder/m-p/635704#M83386</link>
      <description>&lt;OL&gt;
&lt;LI&gt;Read the documentation on Encrypting Scripts in the Scripting Guide&lt;/LI&gt;
&lt;LI&gt;Here is an example.&amp;nbsp; Note, the top part of the script saves a couple of already encrypted scripts.&amp;nbsp; Only the bottom of the script is what you would use to access saved encrypted scripts.&lt;/LI&gt;
&lt;/OL&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;names default to here(1);


// Create some saved encrypted scripts

// Below is an encrypted script that simply does a
// oneway()Oneway( Y( :height ), X( :sex ) )
encrypt =
"//-e12.1
0,
200,4182eJwNy9kBwiAMANB9XIFwlENKE0KhoMD+g+j7f6z01jbXDE3LJBaeCTjQ15Own9a6fQoXi7LcDp5qFrvE96Rneht6PKMy28XR
/336IaXjqrRfBlcsB4SazIgNtDSCujmYUsRq8Jozgmp7HOwaXej6mXfdiMLfaTM2yic22QMpD47KhMnfakSI75AsitcPuvg0Sg==
,0,";
// Save to a file
save text file("$TEMP/encript1.jsl",encrypt);

// Here is a second encrypted script that is simply
// Distribution( Continuous Distribution( Column( :height ) ) )
anotherEncrypt = 
"//-e12.1
0,
224,4214eJwFwQkCwxAQAMD/9Auom+gu60zE/x/SGb5FBzdI3uv2eXW1FZf8JPN43VlFM1r2w+WbNuXU7A9M/X31V4EM5X6nEQJh8xPK
s6yuLeuWmcVN5KeK79TxUImohaaoWzK8cxUaVD9qZymQZFmNY+sp4k7UVwDGCcxeWyuG7rhTdnmy4o+WieaFBBXxIuQGprua2/mF
gakEBpHZN/sI7PMHIYc+CQ==
,0,";

// Save to a file
save text file("$TEMP/encript2.jsl",anotherEncrypt);

// Wait 10 seconds
wait(10);

// Here is the script that runs the 2 saved encrypted scripts

dt =
// Open Data Table: Big Class.jmp
// → Data Table( "Big Class" )
Open( "$SAMPLE_DATA/Big Class.jmp" );
include("$TEMP/encript1.jsl");
include("$TEMP/encript2.jsl");&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 May 2023 18:04:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-call-scripts-and-functions-from-inside-a-folder/m-p/635704#M83386</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2023-05-25T18:04:11Z</dc:date>
    </item>
  </channel>
</rss>

