Keyboard Maestro Editor Megathread


In the spirit of the Logic Pro - Macro Megathread (2022) started by @noisneil, I thought it would be helpful to create a similar thread for the Keyboard Maestro Editor.


Please use this thread to contribute macros that you use with the Keyboard Maestro Editor. Alternatively, if a macro has been contributed elsewhere in the forum, please add a link to it; optionally add your comments.

No macro is too simple; if you find it handy to use, please share it here.


I will contribute the first one: Search All Macros.


If you’d like to format your entry as I’ve done below, here are the steps:

  1. Using Heading 2 enter MACRO:, the macro name, and the version. For example,

    ## MACRO: MacroName, v1.0
    
  2. Optionally include a macro description or any related comments.

  3. Include a screenshot or animated GIF (if applicable). (Note that you can copy a screenshot and paste it into the forum editor; the editor will generate the markdown for the copied screenshot.)

  4. Add the macro download link.

    <mark>(the download link)</mark>
    
  5. Place the image markdown within a folding section. For example:

    <details><summary>Macro-image</summary>
    
    ![Keyboard Maestro Export|593x4048, 75%](upload://ti3lOZCB1hjPk52UhXpur8Ch4zP.jpeg)
    
    </details>
    

MACRO: Search All Macros, v4.0

I have a large macro library and I search often. Using the keyboard only, this macro makes it easy to use search qualifiers that I find particularly helpful.

Download: Search All Macros.kmmacros (58 KB)

Macro-Image


7 Likes

Create and Populate a 'Show Palette of Macros' Macro

Select the macros you'd like to populate a Show Palette of Macros macro with, then trigger this macro.

7 Likes

Hey, @noisneil, thanks for being the first to bite. :sunglasses:

That's a cool macro. Thanks for sharing! And I like the way you included a short description and animated GIF. (I modified the OP and included that in the template.)

2 Likes

MACRO: Insert Action to Check Variable(s), v4.1

This macro is very useful when doing simple macro debugging.

MACRO: Enable/Disable

This clever macro by @gglick is so useful. If I paid Gabe a nickel for every use, he'd be rich (and I'd be poor). :wink:

5 Likes

I'm lazy so I find it easier to hit the ⌘W keys than the ⌘H keys and I tend to view Keyboard Maestro as a utility so closing it makes sense.

After many years I realised that I inevitably open it again very shortly afterwards, so I find that hiding it saves me fractions of time each time I want it open again (there is a very short (edit: it's actually pretty long...) but noticeable time difference between creating a new window and just bringing an existing window to the front).

Hence, this simple macro.

Download: Replace close with hide.kmmacros (2.7 KB)

4 Likes

Thanks, @vincent_ardern. Yes, some of the best macros are very short and simple.

Here’s a few I have created and use quite frequently. YMMV.

Publicly posted macros
These are macros that I have previously posted on the forum and will link to from here.

  1. KMF: Redesigned: Convert Local Variables to Global Variables and Vice Versa
  2. KMF: Automatically Sort Macros According to Containing Group
  3. KMF: (Super simple) Macro to show all (known) trigger names in a display text window
  4. KMF: Smart deletion of typed string

Non-publicly posted macros
These are macros that I have not previously posted publicly, and wasn’t really planning to since these are not designed for public consumption and will require end-user adjustments to work. But since we have this mega-thread going, I will share them here in case anybody wants to peek at them and use them/adapt them for their own use.

Export open macro to a specified folder.

02)[AS-KM] Macros- Export macro to KM folder.kmmacros (10 KB)

Set selected action(s) color

18)[AS-KM] Macro Editing- Set action(s) color.kmmacros (5.5 KB)

New Editor window side by side

29)[AS-KM] New Editor Side by Side.kmmacros (5.7 KB)

3 Likes

Create Pre-Filled Action

Prompts with a list of action types. Each option creates:

Button - button-press action with a user-defined button name
Clipboard - action to display %SystemClipboard%
Text - action to display user-defined text
TriggerValue - action to display %TriggerValue%
Variable - action to display the variable whose field is currently focused
Variable Prompt - action to display the variable whose field is currently focused, in a prompt. This gives you the option to cancel or continue the macro when the prompt appears.
YES - action to display the word "YES". When you use local variables, the editor can't evaluate them, so this helps me figure out which condition of an If/Else is being satisfied.

Create Pre-Filled Action.kmmacros (67 KB)

Macro screenshot

Demo Video

CleanShot 2023-01-29 at 18.21.19


Get Coordinates

  • Trigger the macro and choose whether you would like to capture the coordinates:
    a) between two points, or
    b) relative to the front window's top-left corner. This is useful for apps like Brave Browser, whose from window KM can't 'see'.

  • Follow the instructions via notifications (top-right).

You will then be given a choice:

a) Display the coordinates in a window.
presented with the relative coordinates between those two positions, or
b) Type the coordinates into fields in the Keyboard Maestro Editor.

If you choose the latter, just switch to the Editor and click an action's first coordinate field.

Get Coordinates.kmmacros (69 KB)

Macro screenshot


Copy and Paste Coordinates

There are two flavours of these macros:

Short: for actions whose coordinate fields are all in one row:

Long: for actions whose coordinate fields are on multiple rows:

In use:

  • Click the first coordinate field of a filled-in action and trigger the appropriate Copy macro (short or long).
  • Click the first coordinate field of the destination action and trigger the appropriate Paste macro (short or long).

Coordinate Copy/Paste Macros.kmmacros (105.9 KB)

5 Likes

I've updated the OP with Version 1.1 of Search All Macros.

Bug fix: incorrect smart quotes replaced with dumb quotes.

1 Like

Quick Tip: Put Links to Macros in Comments!

The above title is a link to a post by @DanThomas from Jan 2022 that I am finding useful in organizing and documenting my macros.

In my most recent use, I have a Conflict Palette of various Copy and Paste tools. One that I just added only works if a browser window is the active focus, so it needs to be in its own group with those settings. I have a link to that macro in a Comment in the group which contains the rest of the macros in the Conflict Palette.

2 Likes

I use this macro to rename an action.

Rename the action.kmmacros (30.9 KB)

I use hotkey ⌥R to rename the selected action. I have noticed that as a result I'm more frequently updating the default action value which adds to maintainability.

4 Likes

Me too, @fap. With Keyboard Maestro v10.2 you can use Actions>Rename (⌘R). I'm not sure about earlier versions of KM.

2 Likes

Hi, @August. Thanks for sharing. Based on other macros I've downloaded and used from the forum (no doubt some from @DanThomas), I knew it was possible to create such links. But your post today has inspired me to create a macro that automates the process.

Also, I'm slowly creating a group of utility subroutines and converting many of my macros to use them. The macro links Dan/you suggested come in quite handy if one wants to quickly view the called subroutines. So I did just that. See the header comment in the macro below.


MACRO: Macro Rich Link To Clipboard, v1.0

Keyboard Maestro Export


DOWNLOAD Macro File:
Macro Rich Link To Clipboard.kmmacros (21 KB)
Note: This macro was uploaded in a DISABLED state. It must be ENABLED before it can be run. If it does not trigger, the macro group might also need to be ENABLED.

Macro-image


4 𝙨𝙪𝙗𝙧𝙤𝙪𝙩𝙞𝙣𝙚𝙨 Macros.kmmacros (42.0 KB)
Note: The four required subroutines were uploaded in the DISABLED state. They do not need to be enabled, nor does the enclosing group: .𝙨𝙪𝙗𝙧𝙤𝙪𝙩𝙞𝙣𝙚𝙨

Subroutine-images




2 Likes

MACRO: Navigate to Configured Macro or Subroutine, v2.0

When an Execute a Macro, Execute a Subroutine, or Open a URL action is selected and this macro is triggered, the Keyboard Maestro editor will open the configured macro or subroutine.

For the Open a URL action, the URL must be formatted as follows:

keyboardmaestro://m=keyboardmaestro://m=UUID


DOWNLOAD Macro File:
Navigate to Configured Macro or Subroutine.kmmacros (34 KB)
Note: This macro was uploaded in a DISABLED state. It must be ENABLED before it can be run. If it does not trigger, the macro group might also need to be ENABLED.

Macro-image


4 𝙨𝙪𝙗𝙧𝙤𝙪𝙩𝙞𝙣𝙚𝙨 Macros.kmmacros (34.4 KB)
Note: The four required subroutines were uploaded in the DISABLED state. They do not need to be enabled, nor does the enclosing group: .𝙨𝙪𝙗𝙧𝙤𝙪𝙩𝙞𝙣𝙚𝙨

Subroutine-images





Navigate to Configured Macro or Subroutine also requires subroutine 𝗌.𝗺𝗮𝗰𝗿𝗼⇾SelectedCount. It is available in the group of four subroutines posted with Macro Rich Link To Clipboard. If you have installed that macro and its required subroutines, then you already have subroutine 𝗌.𝗺𝗮𝗰𝗿𝗼⇾SelectedCount.

2 Likes

How is this different from simply clicking on the Action name and then typing a new name? Is it merely that it gets you there with a keystroke instead of a mouse click, or am I missing something?

I don’t think you can change the action name with a single click on the action... for me I have to right-click and then click Rename..., so having a hotkey is faster for me.

2 Likes

Yes, and the ⌘R keyboard shortcut* is already provided in the Keyboard Maestro application was configured by me in the macOS System Settings (formerly called the System Preferences). See my post below for more information.

*There's a potential point of confusion for new Keyboard Maestro users:

  • macOS Keyboard Shortcuts : Like the aforementioned hard-coded ⌘R; this is the term Apple uses in macOS for these key combinations.

  • Keyboard Maestro Hot Keys : This is one type of Keyboard Maestro macro trigger; they normally include modifiers like macOS Keyboard Shortcuts.

Clear as mud, right?

1 Like

Hi, @August.

Unless @cdthomer and I are missing something, a simple action click won't do it. BTW, a double-click does collapse/expand an action.

(As an aside: my personal preference is to always use the keyboard, if possible. I suffer from ergo pain when I overuse a mouse.)

My point above was that a macro is no longer needed to initiate an Action Rename by keyboard. [ EDIT: I've set a ⌘R keyboard shortcut in the macOS System Settings (formerly called the System Preferences). See my post below for more information. In that post, @cdthomer, cleared up confusion that I likely created. ]

For those that like to use a pointing device, there is another option: the action Gear Icon>Rename...

2 Likes

Say what? For me ⌘R activates the record a macro feature...

3 Likes