Slack Copy Paste

Copy and paste text from Slack!

Summary

tl;dr: Use https://slack-copy-paste.danielna.com to copy/paste Slack messages as plain text. It’s not perfect, but it’s a better starting point than copy/pasting text from the application directly.


Background

One recurring annoyance is that it’s difficult to copy/paste conversations from Slack, which is most useful when trying to keep a record of key discussions in Jira or Google Docs. The app does not provide an affordance on its own to export a chunk of text as plain text, and if you’ve ever attempted the highlight -> copy -> paste workflow from Slack before you know what I’m referring to - a lot of line breaks, objects mashed together, the capturing of emoji reactions and counts, etc. It’s no different than attempting to copy/paste complex UI elements within an HTML page, which makes sense because Slack is an Electron app. The text isn’t meant to stand alone outside of the UI treatments.

Here’s a screenshot of a conversation and its raw copy/pasted text:

A screenshot of a slack conversation, which is copy-pasted below

The raw pasted text:




Dan Na
  9:08 PM
Hello this is a test!
:tada:
1



Dan Na
  9:08 PM
:broom: Clean these messages
:+1:
1


2 replies
Last reply 9 days agoView thread


Dan Na
  11:22 AM
I wish I could cleanly copy/paste the text from this conversation into another document! (edited) 

Lots of line breaks and items on new lines. Here’s what this text looks like after running it through my script:

Dan Na 9:08PM
  Hello this is a test!
  [Reactions] :tada: +1

Dan Na 9:08PM
  :broom: Clean these messages
  [Reactions] :+1: +1
  [Thread] 2 replies, Last reply 9 days ago

Dan Na 11:22AM
  I wish I could cleanly copy/paste the text from this conversation into another document! (edited) 

If you select all of the current cleaning options (removing emoji reactions, threads, and joined room notifications), the script removes some more items:

Dan Na 9:08PM
  Hello this is a test!

Dan Na 9:08PM
  :broom: Clean these messages

Dan Na 11:22AM
  I wish I could cleanly copy/paste the text from this conversation into another document! (edited) 

Not perfect, but decidedly cleaner! It also generally works with threads, although the intersection between room/threads needs to be composed manually.

I wrote a disclaimer on the page about the state of the script (in short: it is brittle for many reasons and there is a surprising amount of state in Slack that I inevitably am not accounting for) but you can still edit the output in the second text box before copy/pasting for your own needs. I also cannot guarantee it will work with future Slack UI changes, as a previous iteration of this tool I wrote two years ago became obselete.

A small, utilitarian side project that scratches the occasional itch of wanting to code a solution to a problem. Hopefully it helps someone!


More posts

Previous post

Raising the Floor

Next post

Urgency is a privilege for well-run teams