Macro to extract level 1 headers of Bear markdown notes does not work

Yes - the Search action finds only the first match.

As the KM wiki says:
"Note: This RegEx Search returns only the first match in the source text.\
If you want to process all matches, you will need to use a [[action:For_Each|For Each Action]] as [[:Regular_Expressions#Examples|Shown in this Example]]."

https://wiki.keyboardmaestro.com/action/Search_using_Regular_Expression

Here's my take on your problem:

Download Macro(s): Test Extract Titles.kmmacros (6.2 KB)

Macro-Image

Keyboard Maestro Export

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.1
  • Keyboard Maestro v11.0.2d1
1 Like