1

I'm gathering notes from my Javascript class and everything I cut and paste to TextEdit converts to black text. I've tried Rich text, plain text, Paste and Match style, multi-key combinations found on the web and Apple user guides - nothing.

Here's what I was trying to copy to TextEdit - jus the demo section with colored font: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining

Why does TextEdit convert pasted text to black?

3
  • It may depend on the content. I can cut and paste coloured text from a web page to Text Edit and it retains the colour. Can you provide a link to your problematic text?
    – Gilby
    Commented Jan 19, 2022 at 21:06
  • It doesn't "convert" it. Are you copying it from a source providing styled text? Oddball formatting changes have been a thing ever since RTF was first created. Commented Jan 19, 2022 at 22:29
  • That “text” is not colored. It’s css style sheets that do syntax coloring over top of default plain / black text. You can see the same effect trying to copy colored code text from this site or stack overflow you need an ide or tool to perform syntax coloring if your web page won’t make proper colored text to copy.
    – bmike
    Commented Jan 20, 2022 at 18:01

1 Answer 1

3

TextEdit can open documents in plain text and rich text. It does not strip color from the clipboard, so you are likely not copying text that has color attributes.

To test this you can open three documents and make one plain, two rich. In the second one make text colored and copy / paste it into the other two documents.

Once you’re sure you have things sorted, repeat the copy and paste into one of the rich windows. It’s likely the application from which you copy, but once you’re sure your clipboard is holding colored text you can then look for any extensions or third party apps that might alter items in the clipboard if needed.

If you need syntax coloring, paste the text into a code editor that can perform coloring or try pasting into Xcode instead.

There are tools like hilight that can colorize files and drop that text into the clipboard as well with pbpaste and pbcopy commands.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .