I'm trying to build a listbox which lists down all the opened data table and gets updated automatically with newly opened / newly closed table. I've started with the script below but for some reason the onClose function doesn't work.
Appreciate the help 
names default to here(1);
f1 = function ({Temp_list},
T_list = Temp_list << get name();
lb << remove all;
lb << append (T_list)
);
f2 = function ({Temp_list},
T_list = Temp_list << get name();
lb << remove all;
lb << append (T_list)
);
asub = Subscribe to data table list( , onopen(f1));
Subscribe to data table list(asub , onclose(f2));
nw = new window("Trial",show menu(0),
vlistbox(
T_list = get data table list ();
lb = listbox(T_list);
)
);