Copying Rich Text to the Clipboard from the Command Line on Mac
A colleague recently shared some code to copy plain text Org Mode markup to the clipboard, such that the formatting would be properly represented when pasting in other applications. The idea is you can draft some text in Org (or another markup like Markdown) and then paste it into rich text fields in your web browser or other application.
However, their solution used xclip, which wouldn’t work for me on a Mac. There are some solutions1, 2 that use pbcopy as an alternative, however I found that it didn’t work with Firefox or Slack. I could paste the formatted text into Chrome, but nothing would happen when I tried to paste in these other applications.
Read more