Keyboard shortcut to CLI executable

keyboardmappingscript

enter image description hereI have a couple CLI utilities I would like to map to key combinations. The scripts take no parameters, I merely need to invoke them.

I've seen how to create keyboard shortcuts to apps, but can I point them to an executable somehow?

Best Answer

In your case, you would want to use Automator. You do not need to know about AppleScript to use Automator (in fact, if you open up Automator, you will quickly find that it really is self-evident).

The trick is not just to tie your CLI service to an Automator app, but to be able to get to that globally using a Keyboard shortcut. That can be achieved using a Service. This tutorial explains quite well how to do what you are looking for... in fact, describing a very similar scenario.

I take no credit for the tutorial content, only found it to solve a similar problem (I needed to map some drives at Startup without Finder.app opening while doing so).