Immediate Selection of an Entry in a Prompt With List Action?

Is it possible to get an immediate selection and execution of an item that is selected from a Prompt with list? Now, an extra Enter is necessary.

Of course this only works in case of mnemonics like

a - item
1 - item


As @ccstone's Nyet confirms this is not possible as both User Prompt and Prompt with List don't do anything until you move beyond them to the next Action (usually by pressing OK).

The only thing I can suggest (using Keyboard Maestro native Actions) is something like the below and it is a pretty horrible solution... so, apologies in advance :rofl:


EXAMPLE Choose Item with a key press of its initial letter.kmmacros (3.5 KB)
EXAMPLE Choose Item with a key press of its initial letter

You might be able to do something with the Document.keydown event in a Custom HTML Prompt, but perhaps more work than some saved Enter keystrokes are really worth.

How to “immediately” choose a Prompt With List menu option

I'm very glad that I didn't see this thread earlier or I might not have gone ahead and done what @ALYB is asking for.

The path is fairly simple.

I created a macro that has a separate trigger for each of the 48 individual keys that I might use as a menu choice in a Prompt With List action. The macro spits out the keyboard letter that triggered it, followed by a Return, so I don’t have to type the Return manually.

The macro disables itself after it does this, so that single characters are not reinterpreted elsewhere. The macro that initiates the PWL action enables this macro right before it calls the PWL.

1 Like

This macro has been moved to the Macro Library section.

The “Follow Menu Choice with Return” Macro (v0.5)

I'm not sure if this will meet your needs, but in another thread today I just hacked KM to allow for single clicks in the Prompt with List action to select the item being clicked on and take immediate action. The poster called my solution "insanely cool."

My solution takes action based on a mouse click. I'm not sure if I can modify it to work with keyboard clicks or not.

1 Like

Thanks for the thought. It's pretty essential for my workflow that it be keyboard menu choices and not mouse because I'm using my version to change desktop workspaces and I often do that while dragging a window with the mouse.

Because I'm dragging the mouse, it's also important that the menu triggering hotkey be something that I can type with my left hand. I use ⇧⌃⌥S or ⇧⌥⌘S, depending on which keyboard I'm using, macbook or external.

See the thread in the Macro Library section for how your suggestion of using the "Activate Macro Group" action with the "Activate for one action" option has helped.

Hey @ALYB, I've updated the macro using suggestions from @Sleepy. Take a look.

1 Like