<?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 do I use an existing script from within a script in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-do-I-use-an-existing-script-from-within-a-script/m-p/52267#M29582</link>
    <description>&lt;P&gt;The contents of the script shouldn't run until launched as a table script. Try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = New Table( "test",
	New Column( "Column 1")
);


dt &amp;lt;&amp;lt; new script("test",
	show("Here");
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 27 Feb 2018 21:08:24 GMT</pubDate>
    <dc:creator>David_Burnham</dc:creator>
    <dc:date>2018-02-27T21:08:24Z</dc:date>
    <item>
      <title>How do I use an existing script from within a script</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-use-an-existing-script-from-within-a-script/m-p/52262#M29578</link>
      <description>&lt;P&gt;I have a script right now that acheives the effect I want, but I had to do it in a messy way and I'm hoping someone in the community can recommend a better way.&amp;nbsp; My script allows me to select a csv file, then it cleans up the data and creates a new nicely formatted jump table.&amp;nbsp; I also add a dashboard to that table.&amp;nbsp; The way I do it is shown below.&amp;nbsp; I take my table reference and I add a new script and I paste the dashboard script that I've created elsewhere within the parenthesis of the New Script command.&amp;nbsp; This works, but the problem is that the dashboard script is so big and so messy and changes so often that I have to constantly update my main script.&amp;nbsp; What I'd rather do is save off my dashboard script separately and then load it.&amp;nbsp; In other words something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; New Script(
"Dashboard",
Load("C:\jmpfiles\MySavedOffDashboardScript.jsl")
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;What I actually implemented (with ellipses hiding the messy dashboard details):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; New Script(
"Dashboard",
JMP App(
Set Name( "Dashboard" ),
//...the rest of the messy script here...
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2018 20:55:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-use-an-existing-script-from-within-a-script/m-p/52262#M29578</guid>
      <dc:creator>MikeFromEdwards</dc:creator>
      <dc:date>2018-02-27T20:55:07Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use an existing script from within a script</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-use-an-existing-script-from-within-a-script/m-p/52264#M29579</link>
      <description>&lt;P&gt;The function that you want to "Load" the script is the &lt;STRONG&gt;Include&lt;/STRONG&gt; function.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2018 20:51:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-use-an-existing-script-from-within-a-script/m-p/52264#M29579</guid>
      <dc:creator>David_Burnham</dc:creator>
      <dc:date>2018-02-27T20:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use an existing script from within a script</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-use-an-existing-script-from-within-a-script/m-p/52266#M29581</link>
      <description>&lt;P&gt;I read up on the include function and I think you're right, but I'm still unclear exactly how to use it.&amp;nbsp; I don't want to run the script.&amp;nbsp; Rather I need to get a handle to the loaded script so I can add it to my table.&amp;nbsp; I tried the below but that didn't work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;subsetDt &amp;lt;&amp;lt; New Script(&lt;BR /&gt;"Dashboard",&lt;BR /&gt;Include( "StudyFactsDashboard.jsl", &amp;lt;&amp;lt;Parse Only )&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2018 21:02:03 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-use-an-existing-script-from-within-a-script/m-p/52266#M29581</guid>
      <dc:creator>MikeFromEdwards</dc:creator>
      <dc:date>2018-02-27T21:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use an existing script from within a script</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-use-an-existing-script-from-within-a-script/m-p/52267#M29582</link>
      <description>&lt;P&gt;The contents of the script shouldn't run until launched as a table script. Try this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = New Table( "test",
	New Column( "Column 1")
);


dt &amp;lt;&amp;lt; new script("test",
	show("Here");
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 27 Feb 2018 21:08:24 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-use-an-existing-script-from-within-a-script/m-p/52267#M29582</guid>
      <dc:creator>David_Burnham</dc:creator>
      <dc:date>2018-02-27T21:08:24Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use an existing script from within a script</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-use-an-existing-script-from-within-a-script/m-p/52268#M29583</link>
      <description>&lt;P&gt;The problem wasn't that it ran.&amp;nbsp; It just didn't load the script into the table&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2018 21:15:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-use-an-existing-script-from-within-a-script/m-p/52268#M29583</guid>
      <dc:creator>MikeFromEdwards</dc:creator>
      <dc:date>2018-02-27T21:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use an existing script from within a script</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-use-an-existing-script-from-within-a-script/m-p/52269#M29584</link>
      <description>&lt;P&gt;The way you use it is exactly as you described - juste use Include instead of Load.&amp;nbsp; You don't need the parse message because when you run the table script you want to run the contents of the include file.&amp;nbsp; If the table hasn't been saved then you will need to provide an absolute path rather than a relative path to the include file.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2018 21:15:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-use-an-existing-script-from-within-a-script/m-p/52269#M29584</guid>
      <dc:creator>David_Burnham</dc:creator>
      <dc:date>2018-02-27T21:15:40Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use an existing script from within a script</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-use-an-existing-script-from-within-a-script/m-p/52270#M29585</link>
      <description>&lt;P&gt;It doen't physically copy the contents of the include file - the table script will say "Include ... " but when run JMP will reference that file and execute the contents.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2018 21:17:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-use-an-existing-script-from-within-a-script/m-p/52270#M29585</guid>
      <dc:creator>David_Burnham</dc:creator>
      <dc:date>2018-02-27T21:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use an existing script from within a script</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-use-an-existing-script-from-within-a-script/m-p/52274#M29589</link>
      <description>&lt;P&gt;That worked.&amp;nbsp; The key was to have the full path.&amp;nbsp; Also you're right, I didn't need the parse only keyword.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I really appreciate it!&amp;nbsp; My script is getting really slick and saving me a bunch of work.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2018 21:27:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-use-an-existing-script-from-within-a-script/m-p/52274#M29589</guid>
      <dc:creator>MikeFromEdwards</dc:creator>
      <dc:date>2018-02-27T21:27:35Z</dc:date>
    </item>
  </channel>
</rss>

