Here is a working version of the script. It bypasses the requirement to add the spec limits to the platform code by moving the limits into column properties for the columns in the data table.
Names Default To Here( 1 );
dt = Open( "$sample_data/big class.jmp" );
dtSpecLimits = New Table( "MySpecLimits",
Add Rows( 3 ),
New Column( "Parameter", Character, Nominal, Set Values( {"height", "weight", "age"} ) ),
New Column( "LSL", Continuous, Set Values( [0, 0, 0] ) ),
New Column( "Target", Continuous, Set Values( [50, 100, 50] ) ),
New Column( "USL", Continuous, Set Values( [99, 200, 100] ) )
);
//dtSpecLimits << Save( "C:\Users\user\Documents\MySpecLimits.jmp" );
ltest = dt << getcolumnnames( numeric );
Substitute Into( ltest, Expr( List() ), Expr( Process Variables ) );
// Process the Spec Limits and add them as column properties to the data table
For( i = 1, i <= N Rows( dtSpecLimits ), i++,
Eval(
Substitute(
Expr(
__var__ << set property(
"Spec Limits",
{LSL( __LSL__ ), Target( __Target__ ), USL( __USL__ ), show limits( 1 )}
)
),
Expr( __var__ ), Parse( "dt:" || dtSpecLimits:Parameter ),
Expr( __LSL__ ), dtSpecLimits:LSL,
Expr( __Target__ ), dtSpecLimits:Target,
Expr( __USL__ ), dtSpecLimits:USL,
)
)
);
Eval(
Substitute(
Expr(
dt << Process Capability( FIXME(), Goal Plot( 1 ), Capability Index Plot( 1 ) )
),
Expr( FIXME() ),
Name Expr( ltest ) // ...with ltest
)
);
Jim