Copy Prompt With List search term to clipboard

In attached macro how can I copy the search term (e.g. 'Interspecific competition') entered into the Prompt With List action to the clipboard?

The last action in the macro does not work, but shows what I want to do.

glossary.kmmacros (3.7 KB)

You don't get the "friendly name" portion of the chosen item returned. But you could search GlossaryVar, using the prompt's returned value to get the "friendly" portion:

glossary v2.kmmacros (4.7 KB)

Image

If GlossaryVar gets very large it might be quicker to include all the data in the "hidden" portion of the list items and just extract from the return (I've used tab as the extra delimiter):

glossary v3.kmmacros (3.8 KB)

Image

2 Likes

Which should, I think also work directly with the __

( Custom array delimiters don't have to be single characters )

So this should be enough if you disable the Regular Expression action:

Not in this case -- we're searching the multi-line GlossaryVar, not the single item return from the prompt. Getting "item 2 of the array, using __ as an item delimiter" will (I think, I haven't checked) in this case always return

Interspecific competition
Competition (for food, territories, mates, and so on) that occurs among members of the same species.

...regardless of the prompt item chosen.

1 Like