Wrinkle with styling newline character from OneNote in clipboard

I’m cobbling together a KM palette of macros that style text in OneNoteMac. (OneNoteMac is crippled in some ways compared to OneNoteWindows; one way is that the default text styles cannot be customized.)

The palette works well; the macros are almost there. Each macro cuts the selection from OneNote, applies a style to the clipboard, pastes the clipboard, and deletes the past two clipboards (which I don’t want in the clipboard stack).

The wrinkle I can’t smooth is this: when the last character is a newline, it is not pasted back to OneNote.

(Fair warning:

  • I know little of what I speak. The “newline” does not show in OneNote, but can be shown to be there. Pasted to TextWrangler, with invisibles showing, it appears as a dash with a little downturn at the end — hex 0D, decimal 13, escape \r, unicode 000d.
  • OneNoteMac is crippled in more ways than one, and may not handle fonts or text in any standard way. One peculiarity I’ve worked around with blunt arithmetic is that any styled text — from any program — is pasted at exactly 3/4th the actual point size. Afaict.)

How can I get the pasted styled text to retain the newline?

I tried — perhaps ignorantly — putting in a KM Action that filters the clipboard for line endings. None of the three options (Unix, Windows, Mac) had an effect.


Hi @Kirby_Krieger , did you get your OneNote KM palette working?