
Re: trigger action status in web interface
- Code: Select all
set varName to "fooTest"
set varValue to "true"
if not (variable varName exists) then
make new variable with properties {name:varName, value: varValue}
end if
set value of variable varName to varValue
The above code shows you how to set a variable value and automatically create it if it doesn't exist. Note I'm not suggesting that you append a name onto the variable name, but rather set the variable value to something that represents if it is enabled / disabled. You might want to use "true" and "false" so that you can use the image state on for the variables on the Control Page.
There is not a way (not without hacking the XML database file) to automatically create Control Page elements to show that variable. But, once you run your script and let it create your variables, you can then manually from within Control Page editor create new variable controls.
You then setup your script to run periodically and it will update the variable values which will be reflected on your Control Page.
BTW, I'm adding on my ToDo list (won't happen for initial 2.0 release) to implement a new Control Page element type that reflects the enable/disable state of Trigger and Time/Date Actions.
Regards,
Matt