Hello Scripters,
(W11, 64-bit, JMP Pro 18.1.1)
I'm having some strange behavior with a script that I'm running. The script does several things, but one thing that it does is to create some new scripts to add to the data table. I have to pass some variables to the New Script and have it run in the data table outside of the original JSL. I am adding two new scripts to the data table. One is for visualizing the data with Graph Builder (it works just fine), the other is visualizing the data with the Distribution platform.
Here is the JSL that adds the Graph Builder script (it works great, does exactly what I want it to):
Eval(
Eval Expr(
DOETable << New Script(
"Visualize Graphic Results",
Current Data Table()<<Graph Builder(
Size( 1022, 727 ),
Variables(
X( Expr( Column( DOETable, 1 ) ) ),
Y( Expr( Column( DOETable, 2 * Eval( (npreds + 1) ) ) ) ),
Y( Expr( Column( DOETable, N Items( ListNames ) ) ) ),
Y( Expr( Column( DOETable, N Items( ListNames ) + 1 ) ) ),
Y( Expr( Column( DOETable, N Items( ListNames ) + 2 ) ) ),
Y( Expr( Column( DOETable, N Items( ListNames ) + 3 ) ) ),
Y( Expr( Column( DOETable, N Items( ListNames ) + 4 ) ) ),
Y( Expr( Column( DOETable, N Items( ListNames ) + 5 ) ) )
),
Elements( Position( 1, 1 ), Points( X, Y, Legend( 55 ) ) ),
Elements( Position( 1, 2 ), Points( X, Y, Legend( 56 ) ) ),
Elements( Position( 1, 3 ), Points( X, Y, Legend( 57 ) ) ),
Elements( Position( 1, 4 ), Points( X, Y, Legend( 58 ) ) ),
Elements( Position( 1, 5 ), Points( X, Y, Legend( 59 ) ) ),
Elements( Position( 1, 6 ), Points( X, Y, Legend( 60 ) ) ),
Elements( Position( 1, 7 ), Points( X, Y, Legend( 61 ) ) )
)
)
)
);
Similarly, here is the script for the Distribution visualization, which doesn't work as intended:
Eval(
Eval Expr(
DOETable << New Script(
"Visualize Distribution Results",
Current Data Table()<<Distribution(
Continuous Distribution( Expr( Column( DOETable, 2 * Eval( (npreds + 1) ) ) ) ),
Process Capability( 0 ),
Continuous Distribution( Expr( Column( DOETable, N Items( ListNames ) ) ), Process Capability( 0 ) ),
Continuous Distribution( Expr( Column( DOETable, N Items( ListNames ) + 1 ) ), Process Capability( 0 ) ),
Continuous Distribution( Expr( Column( DOETable, N Items( ListNames ) + 2 ) ), Process Capability( 0 ) ),
Continuous Distribution( Expr( Column( DOETable, N Items( ListNames ) + 3 ) ), Process Capability( 0 ) ),
Continuous Distribution( Expr( Column( DOETable, N Items( ListNames ) + 4 ) ), Process Capability( 0 ) ),
Continuous Distribution( Expr( Column( DOETable, N Items( ListNames ) + 5 ) ), Process Capability( 0 ) ),
SendToReport(
Dispatch( {Expr(ListNames[NItems(Ycols)+1])}, "Quantiles", OutlineBox, {Close( 1 )} ),
Dispatch( {Expr(ListNames[NItems(Ycols)+2])}, "Quantiles", OutlineBox, {Close( 1 )} ),
Dispatch( {Expr(ListNames[NItems(Ycols)+3])}, "Quantiles", OutlineBox, {Close( 1 )} ),
Dispatch( {Expr(ListNames[NItems(Ycols)+4])}, "Quantiles", OutlineBox, {Close( 1 )} ),
Dispatch( {Expr(ListNames[NItems(Ycols)+5])}, "Quantiles", OutlineBox, {Close( 1 )} ),
Dispatch( {Expr(ListNames[NItems(Ycols)+6])}, "Quantiles", OutlineBox, {Close( 1 )} ),
Dispatch( {Expr(ListNames[NItems(Ycols)+7])}, "Quantiles", OutlineBox, {Close( 1 )} )
)
)
)
)
);
When I run the parent script, the two new table scripts are added (again the GB script works just fine), but when I try to run the Distribution script from the data table (green triangle), instead of showing the results, it opens up the Distribution platform window.


NOTE: names have been removed to protect the innocent ;-).
First off, it shouldn't do this, it should actually bring up all the distributions as laid out in the new script (when I run the script stepwise in the parent JSL, it works).
Here's the very strange part. If I open up the new script in the data table (Edit Script), and click Run, it works exactly as intended.


I can't figure out what I'm doing wrong -- the JSL works, but for whatever reason, when I try to run it from the green triangle, it doesn't work, which doesn't make sense to me. Have I missed something or have a wrong call/command somewhere? Have others come across this strange behavior, and if so, how did you get around it?
Any help is much appreciated, thanks!
DS