You have dt as the file path, so it is a string. You need to have it reference the newly opened file, like below. Notice the Open() statement
Names Default To Here( 1 );
// Open a dialog to choose a .jmp file to open
// Get the filename of the .jmp file to open
dt = Pick File("Select a .jmp file to open", "", {"JMP Files|jmp;jsl;jrn", "All Files|*"}, 1, 0, "");
// If the user did not select a file, exit the script
If( Is Missing( dt ),
Throw(),
// Else Open the selected file
dt = Open( dt )
);
// Get all of the numeric column's names
colNameList = dt << get column names( string, continuous );
// Take the data from rows 1 & 2 and create the Spec Limits column property
For Each( {col}, colNameList,
Eval(
Substitute(
Expr(
Column( dt, col ) << set property(
"Spec Limits",
{LSL( _LSL_ ), USL( _USL_ ), Show Limits( 1 )}
)
),
Expr( _LSL_ ), As Column( dt, col )[1],
Expr( _USL_ ), As Column( dt, col )[2]
)
)
);
// Exclude and Hide row 1 & 2 to eliminate them from Distributions
dt << Select rows( {1,2} );
dt << hide and exclude;
// Run the Distribution Platform
dt << Distribution( column( eval(colNameList) ));
Jordan