I'm setting BTT's customVariable1 == 1 (number var) like this:
[
{
"BTTActionCategory" : 0,
"BTTIsPureAction" : true,
"BTTPredefinedActionType" : 292,
"BTTPredefinedActionName" : "Assign or Set Value for Variable",
"BTTVariableType" : 1,
"BTTVariableName" : "customVariable1",
"BTTVariableValue" : "1",
"BTTEnabled2" : 1,
"BTTOrder" : 8
}
]
But when I then use this var in CAG like shown below it seem that the comparison doesn't works - check the below screenshot. If I change the type to Text (BTTVariableType == 0), then the condition becomes "true"
@xidiot I confirm that I am experiencing the same issue: the CAG conditions do not function when I set customVariable1 to Variable type:Number, but they do work when I set it to Text.
I believe this issue may be related to type casting or coercion.
Specifically, consider the following steps:
Assign customVariable1 to type Number and set the value to 1.
Assign customVariable2 to type Text and set the value to 1.
When you run these commands in the terminal, the outputs are not the same:
osascript -e 'tell application "BetterTouchTool" to get_number_variable "customVariable1"'
1.0
osascript -e 'tell application "BetterTouchTool" to get_string_variable "customVariable2"'
1
This discrepancy suggests that the handling of number and text variables is inconsistent.
The CAGs currently don't load these variables dynamically and always expect a string value. Thus it'll fail if the variable type had been set to number in the "set variable value" action.
I plan to have a common condition editor UI for both CAGs and ATCs soon, that will resolve this.