Write your script.
In edit mode, right-click on the field and select "Install Script Triggers ..."
If you want Script to run when the field changes, click the "OnObjectModify" event, and then select the script.
Whenever the field is changed, your Script will now be launched.
source
share