How to use JSL to write a script in the specified JMP file and save it in the JMP?Such as:Abrasion.jmp
dt = Open( "$SAMPLE_DATA/Abrasion.jmp" );
dt << Select Where( Shift == "A" );
d3 = dt << Subset( Output Table( "ts" ), Selected Rows( 1 ), selected columns( 0 ) );
JSL extracts A subset of file "Abrasion.jmp" and creates A script in this subset file that writes the following:
d3 = Current Data Table();
d3 << Sort( By( 6 ), Order( Descending ), replace table );<BR />

Thanks Experts!
Automation and ScriptingWindowsRe: How to use JSL to write a script in the specified JMP file and save it in the JMP?The log indicates that you have a missing ")"
Unexpected end of input. Perhaps there is a missing "," or ")".
Trying to parse arguments of function "new script".
Line 2 Column 59: ...nding ), replace table );►...
You have dropped the training ")" for the New Script statement.
Your code
Eval(
Parse(
"d3<<NEW script=""></NEW>
Correct code
Eval(
Parse(
"d3<<NEW script=""></NEW>
Re: How to use JSL to write a script in the specified JMP file and save it in the JMP?This JSL can write a script with the specified content to a newly generated JMP file.
But here the original JSL seems to have stopped automatically without executing the following code.
dt = Open( "$SAMPLE_DATA/Abrasion.jmp" );
dt << Select Where( Shift == "A" );
d3 = dt << Subset( Output Table( "ts" ), Selected Rows( 1 ), selected columns( 0 ) );
Eval(
Parse(
"d3<<NEW script=""></NEW>
Thanks Experts!

Re: How to use JSL to write a script in the specified JMP file and save it in the JMP?Thank Jim!Re: How to use JSL to write a script in the specified JMP file and save it in the JMP?Here is one way to handle this
Names Default To Here( 1 );
dt = Current Data Table();
Eval(
Parse(
"dt<<NEW script=""></NEW>