Detecting Option Key (⌥) Pressed When Macro Triggered from a Palette?

When the following macro is run from the Keyboard Maestro Editor, it properly detects if the Option Key (⌥) is pressed.

Option Pressed.kmmacros (3.5 KB)


However when the macro is run from a palette rendered using the Show Palette of Macros action the behavior is different.

Keyboard Maestro Export

If the option key is pressed when the macro is clicked on the palette, the macro does not run. Instead the macro is selected in the KM Editor.


@peternlewis, I assuming this behavior is intentional. Is it documented somewhere in the wiki that I'm missing? I checked two places and didn't find anything:

It might be documented in other places, but it is documented here.

Before @peternlewis answers officially, I can confirm as a user that this is intentional and very useful behavior. It works with any palettes including the Conflict Palette.

I use this method constantly as the quickest way to start editing my Macros. I use both Application and Conflict Palettes a lot so, very often I will be looking at a palette that has a Macro I want to use and before using it by clicking on the palette, I decide I want to tweak it. Holding down Option ⌥ while clicking the palette entry, takes me straight to the Macro in the Keyboard Maestro Editor.

I do also use modifier keys to give different behaviors to a macro when clicked in a palette (I just avoid using ⌥). I find Shift or Command work fine. So, submitting Shift or Command for Option in your above Macro will get the behavior you want.

2 Likes

I also use Alt+Click on palettes often.
Is the correct way to set up a Cmd or Shift click action to have an if condition that checks for modifiers?

Yes, you can do exactly as in @_jims's example Macro in the first post but just use any other modifier apart from Option.

Thanks, @Zabobon. Maybe @peternlewis will copy that note and use it on other palette wiki pages.

1 Like

This is a bit of an extreme case, but all of these work just fine:

1 Like