Didn’t that come up already in this thread that you started ? (some solutions given there)
It has also come up twice again within the last weeks, maybe this topic needs an extra tutorial - though I have already written one (“Event patterns and Functions” in miSCellaneous_lib)
BTW ~note is not a global variable, it’s an environmental variable, means it’s bound to the local Environment we’re in currently (currentEnvironment). Just because most people are not changing the current Environment, it somehow feels like global, but it’s essential to keep in mind that it’s not (-> Environment help).