In the scrip modules editor I defined a new script module named ‘buildquery’. The script sets the value of a client tag to true and prints ‘set bit to 1’ to the output console. That is, the module definition includes:
import system
system.tag.write('[Client]TestBit',1)
print 'set bit to 1'
In my project I have a button component which calls the ‘buildquery’ script in a mouse clicked event script. I call the script using:
app.buildquery
print system.tag.read("[Client]TestBit").value
First I zero the client tag then click the button. The output console reads:
set bit to 1
True
The script executes properly. But… if I click the button again the output console only reads:
True
If I zero the bit and click the button again then the output console reads:
False
If I go into the script module editor, select the buildquery script and hit ‘Apply’ and then go back to my project and click the button the console reads:
set bit to 1
True
The script executes properly again, but a second click only generates:
True
in the output console. I get the same behavior if I run the script in the script playground. Why does the script only execute properly the first time it is called after being applied? Am I missing something here?