Change buttons's Statut of a Matrix to 0

Hello

I have a matrix with 4 button to select Color
When we click on it, i’m able to have the state of every button

set toutQuadri to spotMatrixQuadri's |cells|()'s valueForKey_("state") as list

But the problem after is that i can’t deselect them.
So i would like to deselect them via applescript

So i try to change the state

set spotMatrixQuadri's |cells|()'s valueForKey_("state") to 0

but i have the error message :
2014-06-03 11:02:48.649 DinoBox[856:303] *** -[SpotColor currentDocSpot:]: Can’t set «class ocid» id «data optr00000000A0EC040000600000» to 0. (error -10006)

If someone can help, it will be great
Thanks

First, you don’t need to use valueForKey: – uses state() and setState_() instead. Second, you will have to set each cell individually.

HI Shane

I tried to use this fonction with a loop to have every cell :

       repeat with i from 1 to 4
			set spotMatrixQuadri's |cells|(i)'s state_() to 0
		end repeat

But still doesn’t work
I also use set state but didn’t work
thanks

You have to use setState_. Try this:

spotMatrixQuadri's |cells|()'s objectAtIndex_(i-1)'s setState_(0)