I’m having trouble understanding how to change values, particularly the values of records. All of my reading has come up with tons of examples on how to set variables and access them, but I can’t seem to find something to tell me about changing their values.
My main problem right now has to do with records (properties of objects).
why doesn’t this work?
set myProperties to {text:"19 - 25", class:text, color:{0, 0, 0}}
set text of myProperties to "blah"
I can’t seem to get around this problem. I tried an alternative solution which “seemed” to work but didn’t accomplish what I wanted it to. This seemed like it should work but didn’t actually change the text property of the object in my app.
set myProperties to properties of myObject -- which are: {class:text, text:"19 - 25", color:{0, 0, 0}} (for example)
set myProperties to {text:"blah"} & myProperties
set oi to {myProperties, properties of myObject}
get oi
-- result = {{text:"blah", class:text, color:{0, 0, 0},{class:text, text:"19 - 25", color:{0, 0, 0} }
So, I thought, I should just set the value of the properties of object. But I can’t:
set properties of myObject to myProperties --nope. not gona work
Obviously I just don’t understand something properly, a leg up here would be really handy! Thanks!