Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When I paste text to a NSTextView, how to paste plain text only?

When I paste text to a NSTextView, I wish I can paste plain text only. All the rich text formats should be removed, include: font, color, link, and paragraph style. All the text pasted should be displayed with the default font and style of the text view. NSTextView accepts rich text by default, how to disable it?

like image 415
Stephen Hsu Avatar asked Aug 18 '11 03:08

Stephen Hsu


People also ask

How do I paste text into plain text?

Use Ctrl + Alt + V (or Cmd + Alt + V on a Mac) to open the Paste Special window. Here, select Unformatted Text to paste in plain text. Finally, if you'd like, you can set the default paste option in Word to always paste in plain text.

How do I paste text without formatting?

Sometimes you just want to paste as plain text. Microsoft Edge, Google Chrome, and Mozilla Firefox all support Ctrl + Shift + V as a keyboard shortcut for “paste as plain text.” This means that Ctrl + Shift + V also works in browser-based apps, like Teams.

How do I remove formatting when copying and pasting?

Copy and paste-without-formatting on a PC: Ctrl-C, Ctrl-Shift-V. Normal copy and paste on a Mac: Cmd-C, Cmd-V. Copy and paste-without-formatting on a Mac: Cmd-C, Cmd-Opt-Shift-V.

How do I paste into plain text in Excel?

Luckily, there's a simple shortcut you can use in Microsoft Excel to paste text without formatting. To use this shortcut, simply select the cell where you want to paste the text. Then, press Ctrl + Shift + V on your keyboard. This will paste the text without any formatting.


1 Answers

Use isRichText = false to disable rich text.

like image 110
jtbandes Avatar answered Jan 05 '23 00:01

jtbandes