Example Macros to Get Started Using Keyboard Maestro

As part of Keyboard Maestro’s onboarding process, it asks new users if we can set them some Getting Started suggestions, and if they choose to they receive a series of about ten emails with various suggestions for how yo get started with Keyboard Maestro. The emails are plain text, very short, and universally well received (which is not something you can generally say about emails!). One of the emails references some example suggestions:

  • Use Control-D to duplicate a line.
  • Click the mouse after a 20 second delay to allow you to insert custom paper in the printer.
  • Type the clipboard, which clears styles and which works in places Paste might not.
  • Launch Music or Spotify, which you can use from a Remote Trigger on your iPhone.
  • Use a hot key to show & hide utility applications like PCalc.
  • Reset Safari's windows after the web site mangles the window position.
  • Macros that position a window in set locations on multiple monitors (eg left/right columns).
  • Launch your scanner software when your scanner is connected.
  • Change your network location when you connect to your home wireless network.

I was asked recently for a pointer to how to make these macros on the forum, and that seemed like a good idea, so I'm going to go through them and show the examples.

As is my habit, I'm not going to provide downloadable macros because I think it's more beneficial to create such simple macros for oneself to learn the process and see how straight forward it is. This sets people up in good stead to build on the macros with more macros in the future.

  • Use Control-D to duplicate a line.

The trigger is easy, a Hot Key trigger. Duplicating a line is a little actually a little tricky and requires some thinking outside the box. If you type Command-Left Arrow it will generally take you to the start of the line. Shift-Down Arrow will select the line, and then it’s just Copy, Down Arrow, Paste. I like the line to then be selected, so I add a Shift-Up Arrow to the end.

image

  • Click the mouse after a 20 second delay to allow you to insert custom paper in the printer.

This is easy, any trigger you like (such as a Status Menu trigger), and then just Pause and Click.

image

  • Type the clipboard, which clears styles and which works in places Paste might not.

Again, any trigger you want. You can use a Typed String trigger, but remember that that will not work in a password field (where Keyboard Maestro cannot see the typing), so you probably want another trigger as well, perhaps a Hot Key or Status Menu trigger.

To type the clipboard, use the Insert Text by Typing action and the SystemClipboard token.

image

  • Launch Music or Spotify, which you can use from a Remote Trigger on your iPhone.

Launching an application is easy, just use the Activate a Specific Application action. The Remote trigger lets you trigger a macro with a URL from anywhere in the world, so use it with caution as anyone who gets hold of that URL could run the macro. Generally restrict it to macros that would be safe enough if someone executed them (it's not a huge problem if some nefarious person can cause Spotify to activate on your Mac for example).

  • Use a hot key to show & hide utility applications like PCalc.

Again, you can use any trigger you want, such as a Hot Key or Status Menu trigger. Then it is just the Activate a Specific Application action, but note that you can have that action behave differently if the application is already at the front, so in this case we configure it to hide the application if it is already at the front, but there are lots of other possibilities, including quitting the application.

image

  • Reset Safari's windows after the web site mangles the window position.
  • Macros that position a window in set locations on multiple monitors (eg left/right columns).

These two just use the Manipulate a Window action to resize the window.

You can use fixed locations, or for bonus points you can make use of the fact that Keyboard Maestro lets you have expressions in any numeric field, and you can use the SCREENVISIBLE function to make your window size and position depend on the screen size.

For example, to resize a window so it fills most of the screen, you could do something like:

image

  • Launch your scanner software when your scanner is connected.

To do this, you use a USB Device trigger to detect when the scanner connects. Create the trigger, and with the text focus in the trigger field, connect the scanner, and assuming Keyboard Maestro can see it, the field will be filled in with the USB name of the scanner. Then just use the Activate a Specific Application action to launch your scanner software.

  • Change your network location when you connect to your home wireless network.

And finally, this is similar, use the Wireless Network trigger to detect connecting to your home network, and then the Set Network Location action to change the network location (although Apple seems to be phasing out network locations, though they can still be used).

So that should be some useful simple macros to get a new Keyboard Maestro user started and to give some idea of the possibilities.

Note that most of these macros have only one or two actions, and even the one that has a few more, they were trivial actions - you don't need to do complex things to get a huge amount of benefit out of Keyboard Maestro.

5 Likes

Hello Peter (@peternlewis) :wave:

First of all - it’s great to see another Tips & Tutorials Post from you - even though it is dedicated to new users of Keyboard Maestro.

Just a little hint from me - my quote shows something that you’ve maybe missed posting this tutorial.

Hoping for more of such tutorials from you in the future - even though I am a long time user now - it’s often the simple things that I am not aware of. And I am very convinced that I am not the only one here.

Again many thanks :pray: for this tutorial.

Greetings from Germany

Tobias

1 Like

I've fixed the image, thanks.

1 Like

Hi Peter (@peternlewis),

Thank you so much. It helped me a lot to get more familiar with KBM.

Best regards from Austria,
Tom

1 Like