save New Window scripts into data tableI have a lengthy new window script generated by Fit Y by X. It looks like:
New Window( "y vs x",
V List Box(
Fit Group(
Bivariate(
Y( :yy ),
X( :xx ),
.......
I tried to save the new window script in the data table using:
win = New Window( "y vs x",
V List Box(
Fit Group(
Bivariate(
Y( :yy ),
X( :xx ),
.......
dt << New Table Script( "y vs x", win<<GET script=""></GET>
But that didn't work.
Instead of copying the whole script into the jsl_expression in the New Table Script I'm looking for something that's more concise.
Thanks for any help!
Re: save New Window scripts into data tableThanks Jim. It works!Re: save New Window scripts into data tableWhile @cwillden code will save the script for the New Window(), the unfortunate item is that there are issues with the script created in JMP from a New Window().
I have been more successful in creating in the JSL, an expression of the script I am going to create, and then running the script from the expression, and then secondly, converting the literal string and saving it as a script to the data table.
Names Default To Here( 1 );
dt = Current Data Table();
x = Expr(
win = New Window( "y vs x",
V List Box(
Fit Group( Bivariate( Y( :height ), X( :weight ) ) )
)
)
);
Eval( x );
Eval(
Substitute(
Expr(
dt << New Script( "y vs x", __x__ )
),
Expr( __x__ ), Eval Expr( x )
)
);
Re: save New Window scripts into data tableThe problem is the table will literally contain the script "win << get script()" so that script will no longer work once that window named "win" has been closed. Try this:
Eval(
Parse(
Eval Insert( "\[dt << New Table Script("y vs. x", ^win << get script^)]\" )
)
);Re: save New Window scripts into data tableAm I able to apply this to a plot window I already made? If I just want to extract the script for the plots from another script without manually doing it is that possible? I've seen examples where this can be done with graph builder but I can't seem to apply that to a series of X-Y plots.