$ use in matrix script field

It's not possible, $ is only available in the props property.

buttons I can’t figure out as they are executing script

The buttons do trigger the matrix' script but you won't be able to know which button was pressed here (in next release, the id variable will tell you which button was pressed).

Also I am not sure how to set up color feedback for matrix buttons. Any suggestions how to achieve it?

It seems you're trying to build a switch widget out of multiple button widgets, I'd advise a much simpler solution that works since v1.6.0: use toggle buttons with ids that start with the same prefix (in case of a button matrix, that would be the matrix's id since the buttons' id are matrix_id/x by default), and set their script as follow:

if (value) set('matrix_id/*', 0, {sync: false})

In your props property it would look like this:

props.script = "if (value) set('matrix_id/*', 0)"

This will turn off all matching widget (the wildcard "*" tells O-S-C to target every widget whose id starts with "matrix_id/" except the widget that triggered the action.

1 Like