I have a script that starts up, and activates a document event listener using OnSelectionChange. I have set Scripting.DontExit = True, so this script is living a long time. I need to have a condition to deactivate the listener, somehow, or force the exiting of the script. Here's what it does, basically.
Scripting.AttachEvents to Document
onSelectionChange Listener Defined
When someone changes the selection, call a sub that looks for selected components, and output property value to a message window tab
<missing: a good way to exit the script, set the listener to do nothing, or clear the listener>
What is among the cleanest ways to do this? I've considered starting another listener to look for another action, but then I have another listener going. I could have a enable/disable form, and maybe I will in the long run, but I'd like to keep this in a normal script. Could I create a separate script that overrides the previous listener somehow? Open to and looking for ideas!