How do I batch Summarize selected notes or a group?

Most of my Markdown files restate the file name as an H1 header. (I suppose that’s a habit rather than a requirement.) Many times the script captures the file “title” as something worth summarizing, so I frequently end up with results like this:

This certainly involves some conditional logic that strips the header from the line (and perhaps removes the link using regex), but it has been a long week and I’ll just suffer through it for the time being. :upside_down_face:

It is funny that you mention this. I found the same function in your Create Markdown See Also List script (here) and it had me scratching my head. I suppose it’s worth going back to that script and studying that function.

By the way, I wanted to modify the Create Markdown See Also script in two ways that may be interesting or helpful, but I’m having trouble with both:

  1. The script can’t handle notes that start with >. Many of my book notes start with blockquotes from the source material, so the script breaks frequently for me.
  2. I wanted the text excerpt to use Summarize rather than the first n paragraphs.