Those triggers get automatically updated when the commander selects units. I'm pretty sure that the commander needs to be a real player for them to work.
If you are, say, playing a match as commander and want to know the index of the player you selected, use a command like this:
if #MultiSelectActive0# "echo #MultiSelectIndex0#"
else "echo no selection"
Yes, it appears to be for 10 units maximum i'm afraid.
All the variables are updated automatically, so if you want to know the squad color, you got it. No need to edit anything if you just want the index.
I remember nothing about that script, but it should be something like this:
sendscriptinput what commselection value #MultiSelectIndex0#
if #stringequals(|#getparam(what)|#,commselection)# "echo commander selected index #getparam(value)#"
You could even expand the above, adding a ui watch to send information to the server whenever the commander selects anything. Something like:
<panel width="0" height="0" watch="MultiSelectActive0"
ontrigger="If(param, SendScriptInput('what','commselection','value',Mul tiSelectIndex0));"/>
Hope this turns out to be at least a bit useful