Hi @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(),
Spacer Box( Size( 20, 20 ) ),
H List Box(
Panel Box( "Pick a data table",
dlg_dtlb_test = List Box( dtNames, width( 280 ), nlines( 10 ), MaxItems( 1 ) ),
Spacer Box( Size( 10, 10 ) ),
button = Button Box( "Click here to select the table",
dt_test_select = dlg_dtlb_test << getSelected;
dt2 = Data Table( dt_test_select[1] );
colist = {};
Col_List = dt2 << Get Column Names( "String" );
For( q = 1, q <= N Items( Col_List ), q++,
If(
Contains( Col_List[q], "height" ) | Contains( Col_List[q], "weight" ),
Column( Col_List[q] ) << Set Selected( 1 );
Insert Into( colist, Col_List[q] );
)
);
sel = button << set button name( "File selected" );
Caption( "File selected", spoken( 0 ) );
Wait( 0.2 );
Caption( remove );
Wait( 0 );
Wait( 1 );
button << set button name( "Click here to select the table" );,
<<setIcon( "StructuralEquationModelsGoStatus" )
))));
Thanks,
Jay