I want to creat a shortcut by SHift+S to switch "LoadSecurity" on and off.
So:
setting "loadSecurity" silent
works fine
But
setting "loadSecurity" on
or
setting "loadSecurity" off
doesn't work. Why? Is it a bug?
I also tested instead of "on/off", "0/1" and "yes/no". But it doesn't work, too.
Thank you
greetings
Patrick
So:
setting "loadSecurity" silent
works fine
But
setting "loadSecurity" on
or
setting "loadSecurity" off
doesn't work. Why? Is it a bug?
I also tested instead of "on/off", "0/1" and "yes/no". But it doesn't work, too.
Thank you
greetings
Patrick
Posté Thu 05 Sep 19 @ 8:58 am
try to add quotes around "on" and "off"
Posté Thu 05 Sep 19 @ 9:05 am
Why does the loadSecurity option need quotation marks if similar actions like autHeadphones (no/ onload/ always) do not need quotation marks?
Posté Thu 05 Sep 19 @ 11:30 am
Because on and off without quotation marks are recognized as booleans in script parameters.
Posté Thu 05 Sep 19 @ 11:33 am
...and in this case the “on” and “off” are the literal strings for the VDJ setting.
Posté Thu 05 Sep 19 @ 2:21 pm
Okay, that makes sense. Thanks.
Posté Fri 06 Sep 19 @ 7:52 am
I want to build a button in my skin to switch between the "load-security" options "off" and "silent". The Button should be "on" when the option "silent" is active and "off" when "off" is active. But this feedback of the button doesn't work.
<define class="security" action=" setting 'loadSecurity' "off" ? setting 'loadSecurity' "silent" & on : setting 'loadSecurity' "off" & off" >
<size width="48" height="27"/>
<on x="1412" y="1196"/>
<off x="1294" y="1196"/>
<over x="1353" y="1196"/>
<text size="15" weight="bold" align="center" color="#aaaaaa" format="AUTO"/>
<textover size="15" weight="bold" align="center" color="white" format="AUTO"/>
<textselected size="15" weight="bold" align="center" color="white" format="AUTO"/>
</define>
Could somebody help me?
Greetings
Patrick
Posté Fri 13 Dec 19 @ 12:59 pm
1- You try to use double quotes in double quoted string in your action
action=" setting 'loadSecurity' "off" ? setting 'loadSecurity' "silent" & on : setting 'loadSecurity' "off" & off"
would be
action="setting 'loadSecurity' 'off' ? setting 'loadSecurity' 'silent' & on : setting 'loadSecurity' 'off' & off"
or
action="setting 'loadSecurity' 'silent' ? setting 'loadSecurity' 'off' : setting 'loadSecurity' 'silent' "
badly parameters passing prevent button to toggle as there is no param reported
2 -
param_equal "setting 'loadSecurity'" 'silent' ? setting 'loadSecurity' 'off' : setting 'loadSecurity' 'silent'
param_equal `setting 'loadSecurity'` 'silent' ? setting 'loadSecurity' 'off' : setting 'loadSecurity' 'silent'
would hilight the button but query is ignored
3.-
finally a workaround set a var ls and the setting in ONINIT to match the initial wanted state and
action=" toggle ls & var ls ? setting 'loadSecurity' 'silent' : setting 'loadSecurity' 'off' "
another working one : - really dont know why -
action="setting 'loadSecurity' 'silent' ? setting 'loadSecurity' 'off' & param_add 1 : setting 'loadSecurity' 'silent' "
action=" setting 'loadSecurity' "off" ? setting 'loadSecurity' "silent" & on : setting 'loadSecurity' "off" & off"
would be
action="setting 'loadSecurity' 'off' ? setting 'loadSecurity' 'silent' & on : setting 'loadSecurity' 'off' & off"
or
action="setting 'loadSecurity' 'silent' ? setting 'loadSecurity' 'off' : setting 'loadSecurity' 'silent' "
badly parameters passing prevent button to toggle as there is no param reported
2 -
param_equal "setting 'loadSecurity'" 'silent' ? setting 'loadSecurity' 'off' : setting 'loadSecurity' 'silent'
param_equal `setting 'loadSecurity'` 'silent' ? setting 'loadSecurity' 'off' : setting 'loadSecurity' 'silent'
would hilight the button but query is ignored
3.-
finally a workaround set a var ls and the setting in ONINIT to match the initial wanted state and
action=" toggle ls & var ls ? setting 'loadSecurity' 'silent' : setting 'loadSecurity' 'off' "
another working one : - really dont know why -
action="setting 'loadSecurity' 'silent' ? setting 'loadSecurity' 'off' & param_add 1 : setting 'loadSecurity' 'silent' "
Posté Fri 13 Dec 19 @ 4:17 pm