Switch deletes if not used in trigger

18 views
Skip to first unread message

Rightclick

unread,
Jul 2, 2024, 11:40:30 PM (3 days ago) Jul 2
to AutoControl
I noticed that if I don't use a switch in a trigger it will remove itself from the list of available switches. This is unfortunate because I want to check the switch state in the script and not in the trigger. I don't see why this should be the behavior and suggest switches should be removed only manually. 

The workaround is to create a dummy action that uses the switch but it seems like an odd requirement to me._Clipboard01.jpg

Is this the current behavior or am I doing something wrong? 

AutoControl support

unread,
Jul 3, 2024, 12:05:44 AM (3 days ago) Jul 3
to AutoControl
Yes. Switches are deleted automatically when they are not used anywhere.
If you are using a switch only inside a script, then you can use ACtl.pubVar() instead.
You can then define a trigger to toggle that variable on and off (true / false).
Is that suitable in your case?

Rightclick

unread,
Jul 4, 2024, 7:59:56 PM (2 days ago) Jul 4
to AutoControl
I already coded everything to use a switch so it's not worth the effort to change it to a pubVar. I find the behavior a problem more than I need a workaround. Take the common scenario of defining a switch in one action then wanting to delete that action/trigger/condition but use the same switch in a different action. I would have to define the switch again. I don't think switches should be limited / linked with triggers. You should be able to create / delete them from the side panel box and use them wherever, whenever you want until you choose to delete it.

AutoControl support

unread,
Jul 5, 2024, 2:08:48 AM (yesterday) Jul 5
to AutoControl
Thanks for your feedback. We'll add a third argument to ACtl.switchState() to indicate that the switch must be created if it doesn't exist.

Rightclick

unread,
Jul 5, 2024, 7:25:10 AM (20 hours ago) Jul 5
to AutoControl
Sorry, if I understand your fix, it won't solve the problem of the switch being deleted when the last occurrence of it is gone from a trigger. It would still need to be redefined if used in another trigger. 

I just remembered and thought that I should mention that the other main advantage of switches over pubVars is that they retain their state between different chrome profiles which pubVars do not. 

I think they should be delinked from being solely defined in trigger conditions altogether and you should be able to manage them in the switches  box on the AutoControl Configuration Page as explained before. 

Thanks.

_Clipboard01.jpg

Rightclick

unread,
Jul 5, 2024, 7:38:46 AM (20 hours ago) Jul 5
to AutoControl
P.S. Another advantage of switches over pubVars is that they can be easily toggled from the Configuration page / Extension icon menu / custom menu. Maintaining their state between Chrome profiles that are synced is the main advantage for me.

AutoControl support

unread,
Jul 5, 2024, 5:15:03 PM (10 hours ago) Jul 5
to AutoControl
It seems you would benefit from having a "control panel" of sorts, where you could toggle switches and edit script variables by hand without opening the configuration page. Some kind of "always-on-top" small window which is quickly accessible.

There's a pending improvement which will allow you to choose whether a variable is synchronized or not. We'll start by making that improvement and we'll see how to proceed after that.

Reply all
Reply to author
Forward
0 new messages