Event Handler Tag Scope

I’m trying to click a button when a window is activated by using interalframeactivated

if districtnumber==1: system.gui.getParentWindow(event).getComponentForPath('Root Container.Container.Button').doClick()

The issue is that the districtnumber integer only has a scope within the event handler. How do I use a a system/client tag and make it visible to the event handler? There is an indent after the if statement but it didn’t show up when published on the forum.

ok, I think system.tag.getTagValue(tagPath) will do.

Right, you can create a client tag (unique to that client only) to share this information. You can bind any property to the tag using the tag binding and can call the system.tag.getTagValue to read the tag in scripting and system.tag.writeToTag to write to the tag in scripting.