I have a text field that I would like to put a script on which would write that value entered into a few tags defined in the script. I know in vision you can use the propertychange event handler but I do not see anything like that in perspective. How would I go about doing this in perspective?
If you right-click the property in question, you should see “Add Change Script” in the context menu.
You would want to do something like this in the script:
paths = [
'pathOne/MyTag',
'pathTwo/MyOtherTag'
]
values = [currentValue.value for path in paths]
system.tag.writeBlocking(paths, values)
What about
values = [currentValue.value]*len(paths)
paths = ['a', 'b']
values = ['x' for path in paths]
print(values)
['x', 'x']
values = ['x'] * len(paths)
print(values)
['x', 'x']
Same result.