Editing Custom Properties of Templates Through Script


Hoping this will be a simple but having a hard time finding what I need online.

I'm trying to create a pushbutton within a template that will increment/decrement the custom property integer that I created in the template.

Here is what I tried, which worked for OPC tags and such. How can I do this same thing with custom properties in a template?

path = "event.source.parent.Clear_Numeric_Input"
value = system.tag.readBlocking(path)[0].value

if value < 2:
print("Only Recipes 1 - 99 available.")
system.tag.writeBlocking(path, value - 1)


You wouldn't use a tag write for a custom property.
Just increment the property itself.
I am assuming Clear_Numeric_Input is the custom property name on the template?



Doy, lol I knew it would be something extremely simple. Thank you very much!

You should be able to shorten this to:

1 Like