I have a weird issue - if a variable "custom_var_elapsed_minutes" is >= to 54, then a floating menu should show (configured via "Automations & Named & Other Triggers" ), however the floating menu is showing each time the var has a value of 6 (not sure if each time the value is exactly 6, but it is near that value), every time . After var >= 54 the floating menu is showing again - which is to be expected as this is how it is configured.
In the screenshot you can var's value in the top left corner, but the floating menu is shown.
How did you define the variable?
The problem is that the condition is comparing the variable to a string. For a string >= is undefined or might lead to weird behavior.
when defining a variable through scripts it's important to use the appropriate "set_number_variable" or "set_string_variable" functions
It is defined as a Number:
(sharing screenshot because maybe you can spot something which is not configured properly)
This looks good. Did you change this recently? Or is there maybe another place where you set the variable?
Temporary variables are cleared on BetterTouchTool restart, so if you just changed it to number, try to restart BTT. You will need to re-set up the condition afterwards
This is the only place where this variable is set and it is configured as a number since the beginning. About "The problem is that the condition is comparing the variable to a string", I can see that 54 is placed in double quotes, but does that mean it is a string? It is not, right? Also I've tried to set it as string, but again the same outcome.
no for the set variable the quotes don't mean anything. For the condition in your first screenshot it does however. You can try to manually remove the quotes in the condition builder - however it autodetects the type based on the value that is set when the condition builder is opened. Manually changing it might not work.
However I might not understand, if the variable is only ever set to 60, how would the condition ever change?
@xidiot are you using Sketchybar?
Andreas, 100 apologies, I had swapped two variable names, which was causing this. Also the correct variable was set as string, like you suggested in your first post instead as number.
Sorry for wasting your time on this.
No, but it seems interesting. Thanks.
Ah great!
I'm thinking of ways to make this more obvious.
I think at some point I need to replace the system condition builder with something custom...