How can I export only my notes from the Notes app and import to another Mac?
Is there an option to save notes to iCloud?

Yes, in system preferences-&gt; iCloud.



It seems I cannot import a pdf to notes.

You can. The regular method of File-&gt; import-&gt;import file, won't work. You can drag and drop multiple files into a note.



Scripting.

That would be a task for AppleScript.



How to import the notes to new Mac?

If the same Apple ID is used on both Macs, turn on the iCloud for notes (see 1^). They'll sync. If different IDs are used, there is no easy method. You can add collaborators (or people) and send them the invite. Then they can import all the notes to their Mac.