getNoteFieldValue() to clipboard

Viewing 3 reply threads
  • Author
    Posts
  • August 10, 2022 at 11:22 AM #47767

    Bob Williams
    Participant

    I’m trying to copy a summary of some notes to the clipboard. The notes are in a rich-text notes field, so I’m calling getNoteFieldValue() and passing the result into copyTextToClipboard() with the expectation that I’d then be able to paste the formatted text into something like TextEdit. However, what ends up on the clipboard is just the string literal "[object NSConcreteMutableAttributedString]". Am I missing another step?

    August 10, 2022 at 7:17 PM #47768

    Daniel Leu
    Participant

    It works when using record.getFieldValue() instead of getNoteFieldValue():

    function Copy_Note_To_Clipboard() {
    	var note_id = 'fld-xxx';
    	let note = record.getFieldValue(note_id);
    	Utils.copyTextToClipboard(note);
    }
    
    Copy_Note_To_Clipboard();
    August 11, 2022 at 1:24 AM #47769

    Brendan
    Keymaster

    It won’t be the rich text content though. I’ll have to do more work to get it to copy the rich text version of the note to the clipboard.

    August 11, 2022 at 8:42 AM #47770

    Bob Williams
    Participant

    Thanks, I guess I’ll just use the plain text version for now and switch to the other when it’s fleshed out.

Viewing 3 reply threads

You must be logged in to reply to this topic.