Prompt with List (but silently)

There's probably an obvious action for this but it's evading me...

I'm wanting to use something similar to Prompt with List but in the background.

I imagine a variable providing the search term to search the list. Then the list item is returned and fills the source (or different) variable.

Could you provide the use case you're trying to solve? As described, it's a bit hard to figure out exactly what you want, but there are probably quite a few ways to accomplish the task. Using the basic information you did provide, here's one way to tackle it.

I set up two variables. One holds the list, with both the term to match and what to return for that match. The other holds the match to be found.

Download Macro(s): _Silent List Test.kmmacros (3.6 KB)

Macro screenshot

Macro notes
  • Macros are always disabled when imported into the Keyboard Maestro Editor.
    • The user must ensure the macro is enabled.
    • The user must also ensure the macro's parent macro-group is enabled.
System information
  • macOS 13.6.3
  • Keyboard Maestro v10.2

Set the variable to red, and the output is:

And the output is stored in a variable, so you can do with it what you like. But as noted, depending on what you're trying to accomplish, there may be a better way to do this.

-rob.

Thanks for your reply.

So, if I have a list...

A taste of your own medicine
Butterflies in my stomach
By the skin of your teeth
Cat got your tongue
Down for the count
Easier said than done

Instead of being prompted for a search term, a variable provides the search term.

Let's say the search term in the variable is "Count".
Based on the search term, another variable is set to "Down for the count."
(If more than one item is returned, an error dialog is shown (or I could prompt the user to narrow down the results.))

What I may do is just use the Prompt with list and use an action to paste the variable with the search term into the search field.

This is even simpler than the example macro I posted above, which had to match one term with its partner data. In this case, you just need to search your list. The challenge is that there are duplicates—your appears three times, so if you search on your, it will select the first one it encounters.

But ignoring that issue, this macro does what you want:

Download Macro(s): _Match from list via search.kmmacros (4.1 KB)

Macro screenshot

Macro notes
  • Macros are always disabled when imported into the Keyboard Maestro Editor.
    • The user must ensure the macro is enabled.
    • The user must also ensure the macro's parent macro-group is enabled.
System information
  • macOS 13.6.3
  • Keyboard Maestro v10.2

Again, there's no error checking, so if you enter a search word that's not in the list, the macro will fail. But if it's in the list, it will extract the matching line to a variable. Search for tongue, for instance:

-rob.