MACRO: Capture and work with multiple text selections in one pass

This macro demonstrates a method to easily capture multiple selected text strings in one run of the macro. After activating the macro (Shift-Control-Option-5), each selection of text is copied to the clipboard, where each selection can be processed individually.

When the macro is cancelled (by pressing the Control key), a post-processing loop takes over, where the entire group of selections can be processed by further actions. The demo macro does just two things: It builds a long text string with a counter showing the number of each selection, and it builds a Dictionary, where each selection is one entry in the Dictionary (the Dictionary is deleted at the end, so as to not clutter your Dictionaries).

Here's how it looks in action (greatly sped up), showing the selection of multiple lines of text, followed by the display of the text string built from those selections:

An animated GIF resides within

selector9

And here's the macro…

Download Macro(s): The Unlimited Selector.kmmacros (22 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 14.5
  • Keyboard Maestro v11.0.3

I honestly have no idea if this idea is directly useful to anyone, but I like how easy it makes it to collect and manage any number of text selections.

-rob.

1 Like

Nice! The macro as a whole, and some of the components, too.

Thanks for sharing.