cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
jthi
Super User

JSL how to launch JMP platforms with pre-defined selections/options?

Is there any "good" options for running JMP platforms with prefilled options, such as column selections. Below are two options that came to my mind. 

First option is "building" the platform window and then selecting columns from table and pressing button to add those columns.

Second option is first running the platform with JSL script and then << Relaunch Analysis to open the window "prefilled".

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Probe.jmp");

col_list = dt << get Column names(continuous, string);
wait(0);

//Option1
start = HP Time();
dt << Select Columns(col_list);
nw_eo = New window("Multivariate and Correlations", << Show Menu(0), << Show Toolbars(0),
		Platform(dt, Multivariate())
	, << Set Window Icon("ScatterplotMatrix")
);
xpath_path = "//ButtonBox[@title='Y, Columns']";
btn_ref = (nw_eo << XPath(xpath_path))[1];
btn_ref << Click(1);
dt << Clear Column Selection;
Show(HP Time()-start);

// Option2
start = HP Time();
ps = dt << Multivariate(
	Y(Eval(col_list)),
	Scatterplot Matrix(0),
	invisible,
	<< Relaunch Analysis,
	<< Close Window
);
Show(HP Time()-start);

Edit: Slight updates to example script

 

-Jarmo
1 ACCEPTED SOLUTION

Accepted Solutions
David_Burnham
Super User (Alumni)

Re: JSL how to launch JMP platforms with pre-defined selections/options?

My guess is that the closest 'out of the box' functionality is Cols> Preselect Role and the scripted equivalent << Preselect Role.

-Dave

View solution in original post

2 REPLIES 2
David_Burnham
Super User (Alumni)

Re: JSL how to launch JMP platforms with pre-defined selections/options?

My guess is that the closest 'out of the box' functionality is Cols> Preselect Role and the scripted equivalent << Preselect Role.

-Dave
jthi
Super User

Re: JSL how to launch JMP platforms with pre-defined selections/options?

@David_Burnham thanks! Preselect roles seem to be working quite well if only column changes are needed (luckily, in my case no changes to options are needed):

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Probe.jmp");

col_list = dt << get Column names(continuous, string);
wait(0);

//Option3
start = HP Time();
old_roles = Associative Array();
For Each({col_name}, col_list,
	old_roles[col_name] = Column(dt, col_name) << Get Role;
	Column(dt, col_name) << Preselect Role("Y");
);
dt << Multivariate();
For Each({{col_name, role}}, old_roles,
	If(role == "None",
		role = "No Role";
	);
	Column(dt, col_name) << Preselect Role(role);
);
Show(HP Time()-start);
-Jarmo