Automating the Touch Bar in macOS

Reviving the Touch Bar: custom shortcuts and automation

I kept my Touch Bar because it still saves me time. It can be a useless strip of keys or a tiny command centre. The difference is the tools and a few practical automations. This is the setup I use to turn it into something reliable. No theory, just the apps, commands and checks that made it work.

Tools, installs and a sensible baseline

I keep the toolset small. BetterTouchTool, Keyboard Maestro and the built-in Shortcuts app cover most of what I want. BetterTouchTool is the quickest way to map custom shortcuts and build Touch Bar layouts. Keyboard Maestro handles clipboard templates and more involved macros. Shortcuts is useful for macOS automation that needs GUI actions and system services. I use AppleScript and small shell commands when that is simpler.

What I do first:

  1. Install BetterTouchTool and open the Touch Bar editor. The visual editor makes it obvious what will show up.
  2. Create one baseline Touch Bar preset for global shortcuts and one per app. Use BTT’s Trigger Predefined Action to run scripts or send keystrokes.
  3. For more involved flows, build the macro in Keyboard Maestro and trigger it from BTT with a hotkey. Keep the hotkey simple and unique.
  4. Export settings. Both BTT and Keyboard Maestro can export presets, so save them somewhere sensible.

Example: add a simple app launcher

  1. In BTT, click Add New Touch Bar Button.
  2. Label it Slack, choose an icon if you want, and set the action to Run Shell Script / Task.
  3. Use this shell command:
open -a "Slack"
  1. Save and test the Touch Bar button. Slack should open straight away.
    Verification: the app launches within a second. If it does not, check that the shell command works in Terminal.

Permissions and reliability:

  • Grant accessibility and automation permissions in System Settings for BTT and Keyboard Maestro. Without those, scripts and keystrokes will fail.
  • Export your Touch Bar configurations after major changes. That avoids rebuilding after an update.
  • Keep actions idempotent: make scripts that do no harm if run twice. That makes testing safe.

Three workflows that actually improve Mac productivity

I use a small set of automations and keep each one reliable. These three are the ones that have stayed useful.

Workflow 1: app-specific quick bar, with launch, toggle and next window
Value: less mouse travel and faster app work.
Steps:

  1. In BTT, create a new Touch Bar group and set it to show only when a chosen app is frontmost, or set it as a dedicated row.
  2. Add buttons: Open app, Toggle Do Not Disturb via a shortcut, Next Window using the keystroke Command-` or a small AppleScript.
  3. For Next Window, use BTT’s Send Shortcut action and map it to the existing keyboard shortcut for your window manager.
    Verification: switch to the app and confirm the bar shows the group. Tap each button and watch the change happen.

Workflow 2: paste templates and common snippets
Value: cuts out repetitive typing for status updates, bug reports and regular messages.
Steps:

  1. In Keyboard Maestro, create a macro that pastes a template text. Set the macro trigger to a single hotkey, for example Control-Option-Command-T.
  2. In BTT, add a Touch Bar button labelled Template and set its action to Send Shortcut using that same hotkey.
  3. Test in a text field: press the Touch Bar button and the template should paste where the cursor is.
    Verification: the paste appears with the expected spacing and placeholders. If the formatting differs, change the macro to paste as plain text or use a small AppleScript to tidy it.

Concrete example macro body in Keyboard Maestro:

  • Action: Insert Text by Pasting
  • Text:
Status update:

- What I did:
- Next steps:
- Blockers:

This keeps the content consistent and saves a bit of thinking.

Workflow 3: media and quick controls, with play, pause, next and favourite
Value: controls media without touching the keyboard or menus.
Steps:

  1. Add four BTT Touch Bar buttons: Play/Pause, Next, Previous, Like.
  2. For Spotify, use AppleScript actions. Example AppleScript for play/pause:
tell application "Spotify" to playpause
  1. For Like, use AppleScript:
tell application "Spotify" to set shuffling to false
tell application "Spotify" to like current track
  1. Test each button with Spotify open.
    Verification: playback responds instantly. If not, check that Spotify is running and that BTT has Automation permissions.

Small but practical tips

  • Keep the number of Touch Bar items visible to the minimum you actually need. Too many buttons defeat the point.
  • Use icons and short labels. A good icon is quicker to spot than text.
  • For scripts that change state, show a brief notification so the tap gives clear feedback.
  • If you want the same setup on another Mac, export both the BTT preset and any Keyboard Maestro macros. Importing restores the behaviour.

Final takeaways

  • Touch Bar automation works when each shortcut replaces a repeatable small task. Three to five reliable controls is enough.
  • BetterTouchTool handles the UI, Keyboard Maestro handles clipboard and complex macros, and Shortcuts or AppleScript handle system actions.
  • Export presets, keep actions idempotent, and test each button so you can see what changed.

I find the time saved adds up quickly.

Related posts

Weekly Tech Digest | 06 Jul 2026

Stay updated with the latest in tech! This digest covers AI ethics, auto industry shifts, and the impact of politics on technology, exploring today's pressing issues.

wolfCOSE zero-allocation parsing in embedded C

wolfCOSE looks sensible only if you care about what your firmware actually has to carry. I like that, because on small targets the wrong crypto feature can cost more than the message itself, and there...

restic | v0.19.1

restic v0 19 1: safer FUSE mounts and mountpoint checks, robust backup source and exclude handling, clearer CLI JSON output, Windows SFTP deletion fixes