Hey Andreas, is there a way to search across all triggers, across all apps (on the left side)? This could be further enhanced with search across all apps for a particular trigger group (e.g. keyboard, touchpad etc.).
Thank you in advance.
Hey Andreas, is there a way to search across all triggers, across all apps (on the left side)? This could be further enhanced with search across all apps for a particular trigger group (e.g. keyboard, touchpad etc.).
Thank you in advance.
I usually run this command to search across all triggers, apps, etc.
osascript -e 'tell application "BetterTouchTool" to get_triggers' | jq
Unfortunately, I almost always get this error:
āā ļ
¹ ļ ~ āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ī¼ base ī 22.14.0 ļ 00:45:08
ā°ā⯠osascript -e 'tell application "BetterTouchTool" to get_triggers' | jq
38:50: execution error: BetterTouchTool got an error: AppleEvent handler failed. (-10000)
This usually happens after I download a preset. I then need to carefully start removing triggers one by one until the osascript -e 'tell application "BetterTouchTool" to get_triggers' | jq works again. That being said, when the command works, it's great!
Also, I added these two functions to my ~/.zshrc file to easily search Triggers in BTT:
# Function to run get_triggers in BTT with optional parameters using --argument_name syntax
get_triggers() {
local trigger_type=""
local trigger_id=""
local trigger_parent_uuid=""
local trigger_uuid=""
local trigger_app_bundle_identifier=""
while [[ $# -gt 0 ]]; do
case "$1" in
--trigger_type)
trigger_type="$2"
shift 2
;;
--trigger_id)
trigger_id="$2"
shift 2
;;
--trigger_parent_uuid)
trigger_parent_uuid="$2"
shift 2
;;
--trigger_uuid)
trigger_uuid="$2"
shift 2
;;
--trigger_app_bundle_identifier)
trigger_app_bundle_identifier="$2"
shift 2
;;
*)
echo "Unknown argument: $1"
return 1
;;
esac
done
osascript -l JavaScript <<EOF | jq
const BetterTouchTool = Application('BetterTouchTool');
const triggerOptions = {};
if ("$trigger_type") triggerOptions.trigger_type = "$trigger_type";
if ("$trigger_id") triggerOptions.trigger_id = "$trigger_id";
if ("$trigger_parent_uuid") triggerOptions.trigger_parent_uuid = "$trigger_parent_uuid";
if ("$trigger_uuid") triggerOptions.trigger_uuid = "$trigger_uuid";
if ("$trigger_app_bundle_identifier") triggerOptions.trigger_app_bundle_identifier = "$trigger_app_bundle_identifier";
const triggers = BetterTouchTool.get_triggers(triggerOptions);
triggers;
EOF
}
# Function to run get_trigger
get_trigger() {
local uuid="$1"
osascript -l JavaScript -e "Application(\"BetterTouchTool\").get_trigger(\"$uuid\");" | jq
}
I think there is a limitation in how much data apple script can return and triggers with big images or similar cause this to be exceeded. (I'm not 100% sure whether this is the case but it has been my observation in a few limited tests)
Would be interesting to know whether the built in webserver (when activated) has the same issue.
http://127.0.0.1:50863/get_triggers/?
(requires a ? at the end at the moment, even if no parameters are used)
Once I active the webserver and try to access it BTT Version: 5.450 (2025060201) crashes. Am I missing something?
@fortred2, thank you for this, I was expecting something similar to be possible using scripting, but my ask if this is possible in the UI, and if it not - can it be a implemented?
Maybe it is encountering the same issue @fortred2 mentioned, could you send the crash log to me?
Global search in BTT's UI is definitely something I would like to add, but it is complicated. Has been on my TODO list for a long time.
Sent the crash report via the email. Running the below command, does not cause crash, only when access the webserver (no matter if via browser or curl)
osascript -e 'tell application "BetterTouchTool" to get_triggers' | jq
Andreas, were you able to check why this crash happens? BTW still happens on Version: 5.482 (2025061212)
unfortunately I couldn't figure it out yet, the crashlog is too generic, I'd need to somehow reproduce it here but haven't been able to
Btw. do other webserver urls work for you?
E.g.
http://127.0.0.1:50863/get_location/?
(adapt port)
Strange. Could you check whether the new command line interface I added in the latest alpha (5.483) also crashes when calling get_triggers?
/Applications/BetterTouchTool.app/Contents/SharedSupport/bin/bttcli get_triggers
This needs to be first enabled here:
In general that cli will soon support all of BTT's apple script commands and should be the fastest way to trigger stuff inside of BTT.
Yes, once again it crashed. Should I send you this crash report?
BTW the path is "/Applications/BetterTouchTool.app/Contents/SharedSupport/bin/bttcli"
Here is incorrect, but below (adding to PATH) it is correct:
Yes the crashlog would be good, maybe that one contains a little more info ![]()
At least I now know it's not related to the webserver
Crash log sent.
Could you check if it still crashes in 5.484?
Nope, crash is fixed! Thanks!
ah perfect, thanks for testing!