this isn't directly possible within the script because it didn't exists a variable-array through which you could loop. You will need always an additionally step and read all avilable variables with macros (in another variable or a textfile - whereby then you could delete directly) or you read the meta-data from the app and used these information then within the script.
Okay - the whole thing is two-fold anyway:
1) First, it is a one-off job to delete all obsolete variables that are obviously not in use anymore - that can be done via
the variable_manager, I have tested that they don't return after a restart.
2) The second step - what I'm currently doing for this one app - is just going through the script m.o.l. line by line,
noting the names of the variables created and then looking for when they have completely done their job and then
just insert a command to set them to a NULL value.
I will do that - it's a lot of work, but getting everything clean and orderly is worthwhile.
Thanks a lot!