BTT and voice commands on mac?

is there a way to use voice commands (via mac dictation) to trigger events in BTT?

Yes. Voice commands can trigger both Applescripts and open urls. BTT manual demonstrates a way to trigger BTT actions through both. So, perhaps look into that.

Hi there I have zero experience coding and I've looked at the manual but can't make sense of it. Is there any way you could help me set this up?

I'll use one code example which should give you an idea how to go about it

tell application "BetterTouchTool"
    execute_assigned_actions_for_trigger "2F34005D-4537-464D-94E9-A7F42DA39DF1"
end tell

This is a piece of AppleScript which you can copy paste into the "Script Editor" (Use spotlight to open it) and save it as an AppleScript somewhere, say in Documents.

Now, in voice commands you can create a voice command that runs this script which should be easy.

The next step is to have this script call some existing BTT trigger (a keyboard shortcut, mouse/trackpad gesture, Touch Bar button etc.) If you don't have any existing BTT triggers, it'd be advised for this use case to create one in "Named & other Triggers" as a named trigger. You can add any actions to the trigger as usual. After you're done doing that, right click on the trigger and you'd see an option to copy the UUID of that action

This UUID goes in the AppleScript above to tell the script to execute this particular trigger in BTT. In the example above that was 2F34005D-4537-464D-94E9-A7F42DA39DF1 but it would be different for you of course. You could create multiple AppleScript like this and connect with different UUIDs from BTT triggers. Then it's a matter of just running the script using voice commands.

Hi thank you very much for your help

I followed your instructions and assumed you meant to use Automator to set up the voice command.

I ran into a little bit of trouble when trying to execute a BetterTouchTool action which has several sub- actions (see screenshot)

I copied the UUID from the first action only, inserted it into and AppleScript as you said then used Automator to trigger the AppleScript with a voice command

The problem was I wanted to paste this:"deck:JP NewCore10K" Vocab-japan:"(BTT)@clipboard(BTT)" only but couldn’t get it to work

Before giving more details have I done everything right so far?

After some further experimenting it seems that the Japanese text I’m copying to the clipboard each time is what won’t paste correctly although this has worked before when using physical midi buttons as triggers rather than voiceCommands through AppleScript and Automator

I have never used a Midi controller with BTT so your screen looks unfamiliar to me. Could you try going to the Named & Other Triggers section and create a new named trigger instead with just the one action you like ie the one to paste that text in Anki?

I am also slightly confused by the name of your action Paste Text. I'm on the latest version and the only pasting action I have is named Insert / Type / Paste Custom Text which has an option to select whether to paste text in the app OR just type it as if you were typing manually. I'm thinking since you are using the Paste action and it has the clipboard variable, perhaps that could be conflicting? If you could use this action and select typing instead of pasting and see if that changes anything?

I'm also curious now as to what are you trying to achieve here? Are you trying to search Anki for words and then suspend/unsuspend them automatically using voice commands?

Hi again

Changing the option from pasting to typing worked thank you very much

I made a screen recording for you to show you what I’m doing

1 Like