UI to select data tableHi @txnelson ,
I have a jsl code which creates a new window , displays all the data table and saves the column names containing particular string in the list . It doesn't work when the current data table tab has different file (see screen shot below).

The script works well when the data table file is selected in the current data table tab but doesn't work when I select the file from the list box and hit ok. Looking for some suggestion
// sample data file on Big class
dtNames = {};
For( t = 1, t <= N Table(), t++,
Insert Into( dtNames, Data Table( t ) << getName )
);
nw2 = New Window( "Data table selector",
<<MODAL></MODAL>Thanks,
Jay
Automation and ScriptingRe: UI to select data tableYou need to change the active data table to the table the user selects. The easiest way to do this is to add a Current Daa Table() function after the table is selected, and before an action is taken on the data table. See below for the position I suggest
// sample data file on Big class
dtNames = {};
For( t = 1, t <= N Table(), t++,
Insert Into( dtNames, Data Table( t ) << getName )
);
nw2 = New Window( "Data table selector",
<<MODAL></MODAL>