<?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: Remotely run JSL script with parameters in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Remotely-run-JSL-script-with-parameters/m-p/34012#M20168</link>
    <description>&lt;P&gt;Your question has a couple of dimensions to it.&amp;nbsp; The first is the issue of remotely starting JMP, the second one, is a legal issue.&amp;nbsp; There are ways to fire off a JMP session on a remote computer.&amp;nbsp; Most of that would be handled by OS functionality, and it's relationship to the application program you have written.&lt;/P&gt;
&lt;P&gt;The second one, is a question of licensing. You need to make sure that each person running this remote JMP session is covered by your license agreement to be authorized/licensed to run JMP.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 03 Jan 2017 15:54:26 GMT</pubDate>
    <dc:creator>txnelson</dc:creator>
    <dc:date>2017-01-03T15:54:26Z</dc:date>
    <item>
      <title>Remotely run JSL script with parameters</title>
      <link>https://community.jmp.com/t5/Discussions/Remotely-run-JSL-script-with-parameters/m-p/33957#M20131</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We currently have a JMP script which we run for data analysis/reporting. &amp;nbsp;I would like to trigger this script at the end of data acquisition (LabVIEW via ActiveX). &amp;nbsp;I've located the RunJSLFile function but it only has the filepath as an input.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I implement passing a parameter to JMP for use in the script (a string which identifies the part number)? &amp;nbsp;Do I need to use RunCommand to create a global variable which is then utilized by the script? &amp;nbsp;If so, what would the command look like?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Dec 2016 15:27:07 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Remotely-run-JSL-script-with-parameters/m-p/33957#M20131</guid>
      <dc:creator>pjr1121</dc:creator>
      <dc:date>2016-12-29T15:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: Remotely run JSL script with parameters</title>
      <link>https://community.jmp.com/t5/Discussions/Remotely-run-JSL-script-with-parameters/m-p/33961#M20135</link>
      <description>&lt;P&gt;I am sure someone else can do this more&amp;nbsp;elegantly but here is one method using vbscript.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Paste this into&amp;nbsp;a .vbs file on a windows computer.&lt;/P&gt;&lt;PRE&gt;'Create the JMP application object
set jmp = Wscript.CreateObject("JMP.Application")

'Open a data table that already contains your script
set jmpdoc = jmp.OpenDocument("C:/test.jmp")

'Make it visible for demo
jmpdoc.Visible = True

'Set a table variable to be your 'parameter'
jmp.RunCommand("current data table() &amp;lt;&amp;lt; Set Table Variable( ""input"", 20); ")


'Run the script
jmp.RunCommand("eval(Current Data Table() &amp;lt;&amp;lt; Get Table Property( ""add Column"" ));")&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then make a data table called test.jmp in your C drive with a saved script called "add Column" that contains this:&lt;/P&gt;&lt;PRE&gt;dt = current data table();
val = dt &amp;lt;&amp;lt; Get Table Variable("input");
New Column( "Column 2",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Values( {val, val, val} )
	);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Double click the vbs file and you should see a new column with three rows set to 20.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Dec 2016 17:26:25 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Remotely-run-JSL-script-with-parameters/m-p/33961#M20135</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2016-12-29T17:26:25Z</dc:date>
    </item>
    <item>
      <title>Re: Remotely run JSL script with parameters</title>
      <link>https://community.jmp.com/t5/Discussions/Remotely-run-JSL-script-with-parameters/m-p/33963#M20137</link>
      <description>&lt;P&gt;This looks like a viable approach and would work great for tables which contain data to be analized. &amp;nbsp;This application is slightly different as we a processing data which is stored outside of JMP (SQL database). &amp;nbsp;I could create a table to contain the script (essentially a wrapper), but I think there should be a better approach for this application.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The script in question is NOT contained in a table currently. &amp;nbsp;It is a stand-alone *.jsl file which contains custom written functions to load data from various SQL queries, generate multple tables and graphs, and then collect the graphs in a &amp;nbsp;journal.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if I do &amp;nbsp; jmp.RunCommand("ID = "12345";") &amp;nbsp; , will this create a global variable that can be seen by the script.. run via&lt;/P&gt;&lt;P&gt;jmp.RunJSLFile("&amp;lt;path to JSL file&amp;gt;") &amp;nbsp; &amp;nbsp;which utilizes ::ID &amp;nbsp;within various functions?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Dec 2016 17:42:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Remotely-run-JSL-script-with-parameters/m-p/33963#M20137</guid>
      <dc:creator>pjr1121</dc:creator>
      <dc:date>2016-12-29T17:42:21Z</dc:date>
    </item>
    <item>
      <title>Re: Remotely run JSL script with parameters</title>
      <link>https://community.jmp.com/t5/Discussions/Remotely-run-JSL-script-with-parameters/m-p/33965#M20139</link>
      <description>&lt;P&gt;You could include a 'main' function in&amp;nbsp;your JSL script, include it in&amp;nbsp;a JMP&amp;nbsp;session called by a vbscript,&amp;nbsp;and then call the main function in your script with arguments.&amp;nbsp; Here is an example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;.vbs file:&lt;/P&gt;&lt;PRE&gt;'Create the JMP application object
set jmp = Wscript.CreateObject("JMP.Application")

'read the existing jsl script
jmp.RunCommand("include( ""C:/ScriptWithParam.jsl"" );")

'set parameter values
param1 = "some value"

'Run a function inside the script
jmp.RunCommand("MakeTable( """ &amp;amp; param1 &amp;amp; """ );")&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;JSL file:&lt;/P&gt;&lt;PRE&gt;MakeTable = function({param1 = "2"},
	result = 1;
	colvalues = {"Your value was",Char(param1)};
	colvalues = Eval List(colvalues);
	New Table( "test",
		Add Rows( 2 ),
		New Column( "Column 1",
			Character,
			"Nominal",
			Set Values( colvalues )
		)
	);
	show(param1);
	result = 0;
	Return(result);
);&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Dec 2016 19:45:12 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Remotely-run-JSL-script-with-parameters/m-p/33965#M20139</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2016-12-29T19:45:12Z</dc:date>
    </item>
    <item>
      <title>Re: Remotely run JSL script with parameters</title>
      <link>https://community.jmp.com/t5/Discussions/Remotely-run-JSL-script-with-parameters/m-p/34007#M20166</link>
      <description>&lt;A href="http://www.jmp.com/support/help/OLE_Automation.shtml" target="_blank"&gt;http://www.jmp.com/support/help/OLE_Automation.shtml&lt;/A&gt; has documentation</description>
      <pubDate>Tue, 03 Jan 2017 10:23:21 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Remotely-run-JSL-script-with-parameters/m-p/34007#M20166</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2017-01-03T10:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: Remotely run JSL script with parameters</title>
      <link>https://community.jmp.com/t5/Discussions/Remotely-run-JSL-script-with-parameters/m-p/34011#M20167</link>
      <description>&lt;P&gt;Yes, there is some documentation regarding OLE automation, and I've read through most of it.&amp;nbsp; While helpful, for general tasks, such as launching a .jmp file, it seems lacking in regards to the vast posibilities of interfacing with other programs.&amp;nbsp; Is there more detailed documentation somewhere?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For instance, can I remotely launch a JMP script from a computer (which does not have JMP installed) via network access to a computer which does have JMP installed?&amp;nbsp; Or does it need somefiles which are part of the JMP installation (such as jmp.tlb)?.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2017 15:33:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Remotely-run-JSL-script-with-parameters/m-p/34011#M20167</guid>
      <dc:creator>pjr1121</dc:creator>
      <dc:date>2017-01-03T15:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: Remotely run JSL script with parameters</title>
      <link>https://community.jmp.com/t5/Discussions/Remotely-run-JSL-script-with-parameters/m-p/34012#M20168</link>
      <description>&lt;P&gt;Your question has a couple of dimensions to it.&amp;nbsp; The first is the issue of remotely starting JMP, the second one, is a legal issue.&amp;nbsp; There are ways to fire off a JMP session on a remote computer.&amp;nbsp; Most of that would be handled by OS functionality, and it's relationship to the application program you have written.&lt;/P&gt;
&lt;P&gt;The second one, is a question of licensing. You need to make sure that each person running this remote JMP session is covered by your license agreement to be authorized/licensed to run JMP.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2017 15:54:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Remotely-run-JSL-script-with-parameters/m-p/34012#M20168</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-01-03T15:54:26Z</dc:date>
    </item>
    <item>
      <title>Re: Remotely run JSL script with parameters</title>
      <link>https://community.jmp.com/t5/Discussions/Remotely-run-JSL-script-with-parameters/m-p/34013#M20169</link>
      <description>&lt;P&gt;PS: If you have access to the RunCommand from within labview/ActiveX, you can skip the vbs file entirely and put that code into your existing application.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2017 15:59:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Remotely-run-JSL-script-with-parameters/m-p/34013#M20169</guid>
      <dc:creator>ih</dc:creator>
      <dc:date>2017-01-03T15:59:58Z</dc:date>
    </item>
  </channel>
</rss>

