%PromptWithListText% token

Hello, could someone explain how to use %PromptWithListText% token? I've looked at the online help but still can't seem to figure it out. Thanks!
https://wiki.keyboardmaestro.com/token/PromptWithListText

It returns the text typed into the "Prompt with List" action's dialog.

Note: This is not the item chosen, just the user-typed text. If you type nothing then the token will be empty. If you type in "inter" to filter on items containing "inter", the token contains "inter" -- even if you selected the item "Sintered Glass".

How you'd use the token is beyond me, though :wink:

2 Likes

@Nige_S , thank you for the clear explanation. :). It was frustrating not being able to figure it out myself.

1 Like

This macro provides an unrealistic but not ridiculous example, I think.

The cook chooses from a list of available ingredients.

  • If you select by entering digits, that tells the macro that actions should be taken to order more of the ingredient.
  • If the selection is made by entering letters, that tells the macro that there is enough of the ingredient and so it's time to look up some recipes.

Check for stock levels of an ingredient Macro (KM v11.0.3)

Check for stock levels of an ingredient.kmmacros (4.3 KB)

The simplistic structure of local cupboard_contents would almost certainly never be the best choice for any purpose, and is used just to keep the demonstration plain.

1 Like

Expecting me to remember different entry methods for different results in the same dialog is certainly verging on the ridiculous...

The only use case I could come up with was to pre-fill with the last typed filter. Could be useful if you store %PromptWithListText% in a global, or even in a simple loop:

Pre-fill Demo.kmmacros (2.7 KB)

1 Like

But no-one is expecting that, are they? :wink: As I said:

I can think of more interesting examples (none of which require feats of memory! :tropical_fish:) but of course I'm not out to sell the idea of that token… whatever it was called...

1 Like