Hey everyone!
Okay after trying for way to long I am stuck on how to get this code to work. I am trying to make a script that will allow a user to select from a list of open files, and for each file selected the code will copy the data table scripts and then paste them all into a single JSL file that I can then run at a later time and will open all the data tables again. Basically like a way to pack a bunch of data tables into a single file (without having to ZIP them) so it is easier to store more complex analysis. This code does most of what I want but I can't get the table scripts to save to a JSL file, they keep wanting to open a copy of the files.
Names Default To Here(1);
nw = new window("Trial",show menu(0),
vlistbox(
hlistbox(
panelbox("Open data tables",
lb = listbox(get data table list ());
),
panelbox("Data tables to save into one script file",
lb2 = listbox();
),
),
buttonbox("press to select tables",dtla=lb << Get Selected;lb2 << Append( dtla ); ),
buttonbox("press to remove tables",lb2 << Remove Selected(); ),
panelbox("what is the file name?",
teb1=Texteditbox();
),
buttonbox("press to save",
dtlb=lb2 << Get items;
fn=teb1 << Get Text();
list_of_table_scripts={};
For( i = 1, i <= N Items( dtlb ), i++,
y = datatable(dtlb[i]) << Get Script With Data Table();
insertinto(list_of_table_scripts,y);
);
Save Text File( "$desktop\"||fn||".jsl", y );
nw<< Close Window;
)
)
);
teb1<< Set Width( 200 );
Thanks for any guidance!!
Steve