Hi Andreas and BTT Community,
I am trying to trigger a BTT Named Trigger with an argument from a Raycast AppleScript on macOS Sequoia 15.4.1 (Macbook Air M4, BTT 5.294). The desired flow is:
- Raycast runs an applescript that takes in a text argument (inputted by the user, for example a sentence). Here's the current version of it:
AI _ accent fix2 (BTT named trigger) copy.zip (587 Bytes)
- The applescript should trigger a Named Trigger in BetterTouchTool trigger takes the user input and joins it to a ChatGPT prompt.
namedtrigger-aiaccent2.bttpreset (2.8 KB)
However, the applescript isn't triggering the BTT Named Trigger.
Help much appreciated!
Thank you!
have you tried logging the triggerString variable in your raycastr script?
Is it equivalent to your named trigger name in BTT? ("AI / Accents2")
Yes, I have tried to log that triggerString variable just before it was sent to BTT, named trigger name also the same but to no avail…
Maybe some empty space or something?
It is working fine when running
tell application "BetterTouchTool"
trigger_named "AI / Accents2"
end tell
Or maybe there is some misunderstanding? Your named trigger can only be triggered when you trigger its exact name "AI / Accents2" - as soon as you append anything (e.g. your user input) it can not work anymore.
If you want to provide user input to the BTT action you could set it as a string variable:
set userInput to item 1 of argv
tell application "BetterTouchTool"
set_string_variable "trigger_argument" to userInput
trigger_named "AI / Accents2"
end tell
return "Sent to ChatGPT: " & userInput
as you are already using {trigger_argument} in your chatgpt setup, this should work
BTT needed a restart!
Thank you Andreas