I'm writing to the ini file for saving persistent DRO's and it works great. I'm setting up some check boxes using toggle buttons and images and I'm trying to save the state of the button to the ini file on screen unload. It doesn't work. It should be saving the button state in the Preferences section, but it's not. I inserted a message box and it is capturing the button state, just not writing it to the ini. Code is below. What am I doing wrong?
inst = mc.mcGetInstance()
val = scr.GetProperty('togCheck1', 'Button State')
mc.mcProfileWriteString(inst, "Preferences", "togCheck1", string.format (val))