Hello,
I have an add-in outputting a graph with several tables hidden in the background.
Upon closing the window I use the "On Close" function to close related data tables, like this:
New window() << On close(
Close(TableA, nosave);
Close(TableB, nosave);
) ;
The problem is if I run the script twice, TableA of the first run will be overwritten during the second script execution.
I have tried going around the problem by using a Unique ID created at each script launch, like this:
NewWindow() << On Close(
For(i = NItems(GetWindowList() << Get Window Title()), i > 0, i--,
win = GetWindow((GetWindowList() << Get Window Title())[i]);
If(Contains(win << get window title, Eval(uniqueID)) != 0,
win << closewindow()
);
)
)
Unfortunately the same problem remains, UniqueID is overwritten.
Is there a way to reference the tables correctly so that closing the window will close the correct tables?
Thank you in advance for your help!