I would need to send an osc message within a script, with address based on the value of the widget’s current value.
The widget is for ex a switch with values :
{
"Value 1": "foo",
"Value 2": "bar"
}
Expected result :
when I click on « Value 1 » : I’d like it to send a message :
/foo/init bar
If I use the address prop with /@{this}/init
It works just fine.
But I need to do it inside a script.
When my script prop is
send('/@{this}/init', value)
or
send('/@{this.value}/init', value)
it returns :
(DEBUG, OSC) Out: { address: ‘/undefined/init’, args: [ { type: ‘s’, value: ‘bar’ } ] } To: 127.0.0.1:8000
Undefined ?
If I use any other widget’s prop instead of value, it works fine. For ex :
send('/@{this.left}/init', value)
it sends :
(DEBUG, OSC) Out: { address: ‘/10/init’, args: [ { type: ‘s’, value: ‘bar’ } ] } To: 127.0.0.1:8000
So why doesn’t it work with value ?
I also tried :
if (value !== undefined) {
send('/@{this.value}/init', value)
}
…same result
What’s wrong here ?
help please !