Read value from a toggle

Pvdn's icon

How can i read the value (selected/unselected) from a toggle? i don't see that an attribute for that to use with getattr.

brendan mccloskey's icon

Hi
the best I could do is to enable Parameter Mode Enable, thereby allowing one to set the toggle's initial state (0 or 1). This can then be "read" using [sel 0 1]. I guess you could also use [loadmess] to achieve the same thing. This probably won't help if you need to read the toggle state dynamically....

Brendan

brendan mccloskey's icon

....second best I could do:

Max Patch
Copy patch and select New From Clipboard in Max.

Brendan

Pvdn's icon

Reading it dynamically is indeed what i want to do (with js). I don't get it, i seem to be able to read every parameter i see in the inspector, but the most important one (its value, or selected-state) isn't accessible?

ak's icon
Max Patch
Copy patch and select New From Clipboard in Max.

and third ugly-hacky-non_js way:

Max Patch
Copy patch and select New From Clipboard in Max.

and a little nicer pattr-also_non_js:

ahmet kizilay's icon
MIB's icon

I think both n00b_meister and Andrzej are over thinking the non-js just a little bit ;)
unless I am way off base, this is probably the easiest way of doing it... non-js, that is.
Feel free to hit me over the head if I'm wrong!

Max Patch
Copy patch and select New From Clipboard in Max.

M

john.baq's icon
Max Patch
Copy patch and select New From Clipboard in Max.
Pvdn's icon

This was indeed what i was looking for: obj.getvalueof()

Thanks!