You could use a property change script:
if (previousValue is None) or (currentValue.value != previousValue.value):
self.custom.key = str(currentValue.value)
Two things before you do this:
- the value comparison is important to prevent infinite loops because previousValue and currentValue will always have different timestamps and so will never be equal, whereas their values could be.
- the check against previousValue being
None
is important because the first time the change event occurs there is no “previous value”.