I think this following AppleScript solution is a good starting point for you. The following code will make a new Note with the name and text from each currently opened unsaved document in TextEdit.
use Notes : application "Notes"
use TextEdit : application "TextEdit"
repeat with thisDocument in TextEdit's documents
if modified of thisDocument then
make new note with properties ¬
{name:name of thisDocument, body:text of thisDocument}
end if
end repeat
NOTE: For some reason, the above code does not always recognize when a document has been modified. If you run into this issue, just use the following code instead… which will make a note of every opened document whether it has been edited or not. This following version will also name the note with the first 2 words of the document rather than the title of the document. If the opened document only has one word, then that will be the name of the new note
use Notes : application "Notes"
use TextEdit : application "TextEdit"
repeat with thisDocument in TextEdit's documents
try
make new note with properties ¬
{name:(word 1 of text of thisDocument & " " & word 2 of text of thisDocument) as text, body:text of thisDocument}
on error errMsg number errNum
make new note with properties ¬
{name:word 1 of text of thisDocument, body:text of thisDocument}
end try
end repeat