Using Keysmith with other automation apps

by Daniel de Haas

December 3, 2020 · 3 minute read

Keysmith lets you trigger macros in a few ways: with a global hotkey, with an app- or website-specific hotkey, or via the quick launcher. But there are plenty of other situations in which you might want to trigger a macro in Keysmith, like through Keyboard Maestro's MIDI support, or BetterTouchTool's trackpad gestures.

All Keysmith macros have a unique URL that can be used to run them from any tool. In this post, we'll go over a few different ways to make that work.

Keysmith Macro URL

The first step is finding the URL for the Keysmith macro you want to run. To do so, open the Keysmith editor, select the macro you'd like, and then select File > Copy Macro URL in the menu bar.

A screenshot of the menu item to copy a macro URL

The URL will look something like this: keysmith://run-macro/ABC-123-DEF-456

BetterTouchTool

BetterTouchTool is a great Mac app that, among a host of other things, lets you trigger actions via your keyboard, mouse, or trackpad. (And, like us, they're available on Setapp!).

Triggering a Keysmith macro from BetterTouchTool is really straightforward. Choose your trigger, then add the "Open URL / Open URL With Selection" action. A box will pop just below the dropdown where you can paste the macro URL.

A screenshot of running a Keysmith macro from BetterTouchTool

Keyboard Maestro

Keyboard Maestro makes it similarly easy to trigger a Keysmith macro. Add the action called "Open a URL" and paste the macro URL into the textfield. Make sure "Default Application" is selected and it'll work like a charm.

A screenshot of running a Keysmith macro from Keyboard Maestro

AppleScript

Lots of tools support running an AppleScript, which opens up a world of possibilities. Running a Keysmith macro from an AppleScript is a one-liner:

open location "keysmith://run-macro/ABC-123-DEF-456"

Just replace the URL with your macro's URL (but make sure you keep the quotes!)

Shell Script

Running a macro from a shell script is one word shorter than from an AppleScript! It's just:

open "keysmith://run-macro/ABC-123-DEF-456"

Stream Deck

We've had several of our users write in to tell us that they'd like to trigger a macro from their Elgato Stream Deck. While we don't have first-class support for the Stream Deck, you can still trigger a macro either by having the Stream Deck press its hotkey, or by having the Stream Deck execute an AppleScript, as described here.

Lightning Round

We'll end with a grab bag of ways to run a macro from a bunch of different programming languages. But if your favorite isn't listed here remember that this is as simple as opening a URL, which should be easy to Google. If you can't figure out how to trigger a Keysmith macro from some other app, tool, or service, please reach out, we'd love to help!

HTML

<a href="keysmith://run-macro/ABC-123-DEF-456">
  Click me!
</a>

Python

import webbrowser
webbrowser.open('keysmith://run-macro/ABC-123-DEF-456')

Ruby

system('open', 'keysmith://run-macro/ABC-123-DEF-456')

JavaScript

require('child_process')
  .exec('open keysmith://run-macro/ABC-123-DEF-456')

Swift

NSWorkspace.shared
  .open(URL(string: "keysmith://run-macro/ABC-123-DEF-456")!)