I tried bear’s script and was not happy with the results. It does not export images and only worked on 257/329 notes. It also did not report the failures.
I also tried the notes app exporter. This worked on 312/329 but similarly does not export images and dumps to txt files.
Neither bear or notes app preserves the directory structure. Bear does seem to add a tag at the end of the note indicating which project it was under in apple notes.
I found this app on the app store and it performed the best, but did not work for images. I like that it is on the app store vs write app’s being a download from their website. It exports directly to markdown and it only failed on 3 of my notes, which it reported and had an html version dumped. It also preserved my projects in the export directory structure. However, while it claims to support images, it created empty “attachments” directories with no images.
Just wanted to add this update in case it is useful to others since the two suggestions did not work best for me. Please let me know if you know of an option that works well with images.