Background
I'm using a KM Search action with a regular expression that has a number of capture groups. Since I'm building a general-purpose utility, the Search action is inside a subroutine and I wish to pass the regex as an input parameter to the subroutine.
The Problem
Normally by typing the regex literally into the Search action, the action itself automatically identifies capture groups and offers up the opportunity to assign them to KM variables as in this example:
This is the normal standard behaviour which I would also like to occur in this case when the regex is stored in a KM variable. But using the same regex in a Search action actually results in this:
So I can no longer access the capture groups…
The Question
Does anyone know of a way to force the Search action to show a number of capture group options in the second of these two cases without typing in the literal regex itself? So, for example, if I know the regex contains 3 capture groups, I would want to "force" the Search action to have 3 capture group options.
If anyone wants to play, here's a macro that contains both the above examples:
Download Macro(s): Test Demo Capture Groups Problem.kmmacros (4.6 KB)
Macro-Image
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 10.14.6
- Keyboard Maestro v10.2