Honestly I have no idea the bulk of this script is from a sample scrip included with KIX version 4.51. I added the nonfuncting WriteValue part.