Here is a modification to your script that will allow it to work. You were heading down the correct path, you just needed to use the :Name() function in the Substitute function
Names Default to Here(1);
dt1 = Data Table( "Example1" );
dt2 = Data Table( "Example2" );
a = N Rows( dt2 );
colNamesList = dt1 << get column names( string );
For( i = 1, i < a, i++,
Eval(
Substitute(
Expr(
If( Try( __col__ << get name, "" ) != "",
__col__ << Set Property(
"Spec Limits",
{LSL( _LSL_ ), USL( _USL_ ), Target( _Target ), Show Limits( 1 )}
)
)
),
Expr( __col__ ), Parse( "dt1:Name(\!"" || Column( dt2, "ColumnName" )[i] || "\!")" ),
Expr( _LSL_ ), dt2:LSL[i],
Expr( _USL_ ), dt2:USL[i],
Expr( _Target ), dt2:Target[i],
)
)
);
Also, I added in a check to make sure the column is found in the target data table, so the script does not error out, and stop processing before all records are processed.
Jim