How do I batch Summarize selected notes or a group?

Thanks, @pete31. I have a lot of trouble navigating Applescript so I appreciate the in-depth assistance. (And thank you for mentioning Script Debugger!)

I tried to adapt Blanc’s highlight summarization script to summarize rather than summarize highlights by changing:

summarize highlights of records {thisItem} to sheet in theDest # or use "markdown" or "rich" instead of "sheet"

to

summarize {thisItem} in 10

I keep getting a type error: DEVONthink 3 got an error: Can’t make {content id 104975 of database id 2} into type string. Is this because I am trying to operate on a record, and I need to do something like this?

set someVar to get plain text of {thisItem}
summarize someVar in 10