Toggle a script panel on/off
Is it possible to have a script be toggled on and off with the same keypress?
At the moment I have the measure tool floater bound in a macroscript that pops up on keypress, but I would like it to disappear if the same key is pressed and it is already active.
I've seen destroyDialog used, but I'm not sure how to get it to check if it is already active, and if it is to close it and not to reopen a new instance.
Any pointers appreciated!