rxhanson / Multitouch-Community

Issue and feature request tracking for the Multitouch app
https://multitouch.app
39 stars 0 forks source link

Integration with Keyboard Maestro #191

Open Detnator-Neo opened 7 months ago

Detnator-Neo commented 7 months ago

Don't know if you're familiar with Keyboard Maestro (KM). It's freaking awesome and there's very little we can't do with it. But it has one major limitation and that is you can't invoke any of its macros with any mouse/trackpad gestures.

I wrote to the author about that and he said there was some technical reason why it was virtually impossible to do it.

But since you've got gestures triggering actions figured out, what if one of the actions you have was "Keyboard Maestro macro", and if I choose that action then I get a list of my KM macros and can choose one. The gesture then triggers that action.

This is actually already possible, with your bash option. But it'd be cool if this could be built into Multitouch.app's UI.

Two parts to that:

  1. I can invoke a KM macro via its name, or it's built in UUID, using a command line tool that KM has ("/Applications/Keyboard Maestro.app/Contents/MacOS/keyboardmaestro"). So a bash command like "/Applications/Keyboard Maestro.app/Contents/MacOS/keyboardmaestro" 9BF8DE3E-0F17-4276-8882-2FD4DA93D3BE or "/Applications/Keyboard Maestro.app/Contents/MacOS/keyboardmaestro" "My Macro Name" will do what I'm proposing nicely.
  2. For you getting all the Macros from KM to display, it's AppleScriptable, so tell application "Keyboard Maestro" to get every macro would get them all, then ideally you could arrange them by their Macro Groups. Then behind the scenes, when I select one, you could build the bash command (by UUID is probably better than by name, because if we change a macro's name in KM it'll break the connection) and have it run that when we do the corresponding gesture.

What do you think?

rxhanson commented 7 months ago

I agree with this concept, but at the moment I don't have plans to add it in.

Early on in developing Multitouch, I spent some time creating scripting bridges to interact with a lot of different apps via their apple scripting interface. Apple then added some confusing security warnings that made using scripting bridges burdensome. It was annoying enough that I ended up dropping the scripting bridges from the app.

Even if I avoided scripting bridges entirely and built out a bash script API to Keyboard Maestro, it would be placing trust that none of those interfaces will change. It may be quite unlikely that those interfaces will change, but it pushes support/troubleshooting of Keyboard Maestro into Multitouch's domain.

On top of that, the overlap of Multitouch users and Keyboard Maestro users might be relatively small, so this could be catering to a pretty small niche.

With all of that said, if I had enough demand for a feature then I would still consider it.

Detnator-Neo commented 7 months ago

That's all fair enough. I can appreciate that. I agree it might be a niche, although I wonder... the kind of people who would use Multitouch -- ie. people who want to customize their Macs more -- might just be exactly the same kinds of people who'd use KM...? Maybe you can ping your users to ask...? 😊

Either way, not a big deal since I can do it manually using the approach I explained via the bash script option you have. So this is more a nice to have than a deal breaker or anything.

Thanks for the detailed explanation.