I edited your initial post and moved the JSL and its output into a JSL window and a Code window respectively, by using the input icons at the top of the edit input window.
I have also modified your code to have the << get column names, return strings, and instead of using Loc(), using Contains() to return a single value rather than a matrix value.
Names Default To Here(1);
dt = Data Table("Test Table");
dt << Bring Window To Front;
Show(dt << Get Name);
// Step 1: Get all column names and show them
colNames = dt << Get Column Names(string);
Show(colNames);
// Step 2: Find the index of the "Adders" column
targetColName = "Adders";
// Loc() returns a matrix, contains returns a scaler value
colIndex = contains(colNames, targetColName );
Show( colIndex ); // Should be > 0 if found
// Step 3: Try to visually select all columns to the right
If( colIndex > 0 & colIndex < N Cols( dt ),
dt << Clear Column Selection;
For( i = colIndex + 1, i <= N Cols( dt ), i++,
Column( dt, i ) << Set Selected( 1 )
);
// Step 4: Show what JMP thinks is selected
selected = dt << Get Selected Columns;
Show( selected );
,
New Window( "Error", Text Box( "Column 'Adders' not found, or it's the last column." ) )
);
Jim