Page 1 of 1

_getText !

Posted: Fri May 06, 2016 12:36 pm
by Issachan
Hi guys,
I have a cool script made by Dave for updating text on a label button "POWER", I would like to update an image of another button "COLOUR" based on the text of the "POWER" label.
I tried with _getText.
Script like this

_getText('POWER'); {
if ('POWER', 'STANDBY'); {
return 'COULOUR[@]DirecTVRemote/round_amber_40px.png';
} else if ('POWER', 'ON'); {
return 'COULOUR[@]DirecTVRemote/round_red_40px.png';
}
}

i also tried with
_setImage('COLOUR', 'DirecTVRemote/round_red_40px.png');
but fail :p

Can someone help please ? thanx.

Re: _getText !

Posted: Sun May 08, 2016 12:39 am
by Dave
I believe the script should look something like this:

var buttonText = _getText('POWER');
if (buttonText == 'STANDBY') {
return 'COULOUR[@]DirecTVRemote/round_amber_40px.png';
} else if (buttonText == 'ON') {
return 'COULOUR[@]DirecTVRemote/round_red_40px.png';
}

The _setImage script looks correct, you just need to ensure that the image name EXACTLY matches the name you provide, including upper/lower case, etc.

Hope this helps.