Is it possible to have a button for BTT that activates a button in an app?

Take Anki for instance, a flashcard app. There are tons of buttons in this app, but the app doesn't really have keyboard shortcuts. I'd like to make a BTT layout for it, but I can't seem to come up with a way to tie a touchbar button to a button in the app.

Does there need to be a keyboard shortcut to map, or has anyone found any clever ways to tie a touchbar button to an app that doesn't have keyboard shortcuts?

When editing/studying many of the buttons do have keyboard shortcuts.
Here is the group that will be added to my preset (should be online in two weeks or so, have some tiny bugs I need to chase down).

(Group when studying cards)

(Group when making cards)

Both of the groups are CAG so they pop up depending on what you are doing.
I did not find a way yet to show your decks in the TouchBar though…

I though used some Add-ons for Anki such as "Customize Keyboard Shortcuts" (24411424) or "Mini Format Pack" (295889520) and modified them a little bit.

Otherwise, the safest option is always to run attached actions like

  • Save current mouse position
  • Move mouse to position x-y from top right corner
  • Left Click
  • Restore previous mouse position

This doesn't work in Anki though as it works with several windows shown as one. You would have to use the "Position of the screen" option for the move mouse to" meaning Anki should always run fullscreen to ensure its correct handling. The thing is that with Anki clicks were sometimes not recognised for me (check my very ghosted bug report here). But my screenshot solution below does the job :+1:t3:

Yeah I tried doing the mouse movement, but for whatever reason the "left click" action didn't seem to actually be doing anything.

I've been mostly trying to find a way to launch Anki (Have that done), and select one of my decks based on number (Deck 1 being "1", deck 2 being '2"), and then studying with that. But it doesn't seem like you can assign selecting decks to specific keypresses.

Oh that's all? That's super easy, with the only restriction that you have to make one button for every deck.
Create a new TouchBar Button that launches Anki.app Then attach some actions:

  1. Key "/"
  2. Paste text: "name of your deck"
  3. Key "⏎" (enter)
  4. Delay next action by 0,5sec
  5. Key " " (space)

Should look like this for opening the deck "neurology"


The thing is that for speed reasons Anki needs to be already open. Or you would have to add some more "delay next action" and play with the time interval.

Info: Instead of 1. Key "/" you could also trigger the menu bar item (6);(1) but may have to delay the trigger a bit.

Huh, not particularly sure why I didn't think of that because I knew the / key existed. I should maybe try to use BTT when it's not 2am and I haven't been watching GoT for 7 hours to get caught up lul

1 Like

The iOS version of Anki is pure gold, super well coded and fun to use. Totally worth the 20€!! Like really totally.
But the Mac app feels sometimes kinda neglected and inconsistent. I don't know if this comes from the Add-Ons or the Open source code but it doesn't feel that smooth than iOS.

Happens to the bests :smirk:

Yeah I have the iOS version. I'm not really sure why it's $25 though when the Android version is literally the same thing and free.

Because AnkiDroid is not coded by Damien. Another group did it. Anki on iOS is better made, more refined and more capable.
Considering we get Anki and AnkiWeb for free, dont you think sparing 25$ for the app is worth it? Its cheap according to me, considering how much of a help anki is.

1 Like