Here is a simple example of what you will have to do to create such a script. Components that you will not be able to get from JMP, you will have to add into theScript as you build it. Basically, you just concatenate it as you go. Then when done, you add it to the data table.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
dt = current data table();
theScript = "\[dt = current data table(); ]\";
If( try( dt:ratio << get name,"") == "",
dt<<new column("ratio", formula(:height/:weight))
);
theScript = theScript ||
"\[
If( try( dt:ratio << get name,"") == "",
dt<<new column("ratio", formula(:height/:weight))
);
]\";
biv = dt << bivariate( x( :ratio), y(:weight ) );
theScript = theScript || Char( biv << get script );
Eval( Parse( "\[dt<<new script("Saved Script",]\" || theScript || ");" ) );
I have also used a method where I first build the entire script as a literal string, and then save it as a script. Then I turn around and run the saved script, which then gives the results.
theScript = "\[
dt = current data table();
dt << bivariate( x(:weight), y(:height));
]\";
Eval( Parse( "\[dt<<new script("Saved Script2",]\" || theScript || ");" ) );
dt << run script("Saved Script2");
Jim