Hi @Andreas_Hegenberg , Hi All,
I'm experiencing an issue where variables set using set_string_variable
do not seem to persist after BetterTouchTool is restarted.
I initially tried to save data (an array of favorite crypto IDs as a JSON string) from a Floating WebView widget using the JavaScript function await set_string_variable({ variable_name: "my_webview_variable", to: jsonString });
.
To debug, I created a separate AppleScript trigger (get_string_variable "my_webview_variable"
) assigned to a keyboard shortcut.
Before restarting BTT:
Running the AppleScript trigger correctly returned the JSON string that was set by the WebView's JavaScript. This indicates the set_string_variable
call from the WebView was received by BTT initially.
After restarting BTT: Running the same AppleScript trigger returned nothing. The variable seemed to be lost during the restart.
To rule out issues with the WebView interaction, I performed a simpler test using only AppleScript triggers:
tell application "BetterTouchTool"
set_string_variable "test_persistence_variable" to "Test Value " & (random number from 1 to 1000)
return "Test Variable Set!"
end tell
tell application "BetterTouchTool"
return get_string_variable "test_persistence_variable"
end tell
runAppleScrpti 1 correctly sets the variable.
run appleScript 2 before restarting BTT correctly displays the "Test Value xxx" in the script result.
After completely restarting BetterTouchTool , pressing only appleScript 2 results in "no value being displayed"
This simplified test seems to confirm that the issue is with BTT's core ability to persist variables set via set_string_variable
across restarts on my system, as the problem occurs even when using only AppleScript.
i checked in the btt doc this page Using Variables in BetterTouchTool
it describes the variable system itself. it reaffirms that the variables im using should be persistent. However, it provides no explanation or solution for the case where this persistence fails, even though the functions seem to be called correctly (as evidenced by the pre-restart tests).
Is there anything else to do to make everything persistent after restarting Better Touch Tool?