BTT Touch Bar + Alfred Integration

This preset displays buttons for triggering Alfred workflows in the touch bar when the Alfred search bar is activated with a keyboard shortcut (e.g. cmd-space). Could be useful if you have a large number of Alfred workflows and have trouble remembering them.

Here's what it looks like (workflows not included):


It works by:

  1. Using BTT to setup a keyboard shortcut that simultaneously activates the Alfred search bar (via applescript) and a touch bar group
  2. Setting up an external applescript trigger for the workflows in Alfred and creating buttons for triggering those workflows in the touch bar group
  3. Using BTT to create an escape key that also closes touch bar groups

It works this way because there's no way to detect the Alfred search bar itself. This does cause some problems:

  1. This wouldn't work for you if you don't want the escape key to close groups. But you could workaround this by creating an escape key that closes groups specifically for the Alfred workflows group.
  2. Left clicking anywhere outside the Alfred search bar when it is open closes the search bar, but not the touch bar group. BTT can detect left clicks but there is no option to trigger actions using left clicks. @Andreas_Hegenberg would it be possible to add that option? Given that option, I would use a conditional activation group to close the Alfred workflows group on left click.

On the whole though I find that it works quite smoothly.

Installation:

This is great.

Is there much work to do to get it working with Alfred 4?

Figured it out. Reimported and pointed toward Alfred 4. Works fine now :slight_smile:

1 Like

for anyone else interested: to make it work with Alfred 4 (and from now on, all future versions of Alfred) you'd just have to replace every instance of tell application "Alfred 3" in the applescripts with tell application id "com.runningwithcrayons.Alfred".