Slack Copy and Paste
Last updated: 2023-02-05
It's annoying to copy and paste chat records from slack into other documents (e.g. Google Docs),
even as plain text, due to various reasons: spacing, time values, emoji status icons, etc.
This page allows you to strip out formatting from chat records so it's easier to copy and paste as
plain text. There's a surprising amount of state when it comes to slack messages, names, integrations, etc.,
and to make this functional I need to make some assumptions (listed below). This script also breaks
whenever slack makes seemingly innocuous UI changes, which I can only assume happen in A/B tests and/or
Consequently this tool might be broken at any given time! But it's free so you're getting what you paid for.
It also relies heavily on regex and regex is always an adventure. Shout out to the real MVP, https://regex101.com/.
This script makes no external requests! Your slack conversations are cleaned client-side only.
How to use this
- Highlight text from slack, moving from top-to-bottom. Make sure the first word you copy is the username of the first messsage.
- Copy the text via Command+C (or equivalent).
- Paste the text via Command+V (or equivalent) into the top textarea. Notice that the spacing is funky and the pasted text has a lot of strange artifacts.
- Choose options of Slack artifacts to remove from the cleaned up text via provided checkboxes.
- Click "Clean slack log!" to reformat the pasted text into the bottom textarea.
- Manually edit the outputted text as necessary.
- Click "Copy to clipboard" to copy the contents of the bottom textarea to your clipboard.
- Slack is in English
- Copy/pasted text should begin at the beginning of a message, starting with a username
- Slack display names contain only letters, numbers, apostrophes, hyphens or spaces (it's actually much more permissive than this in practice)
- There is a 3-digit maximum number of replies to a thread
- Apps (like hubot) are designated via "APP"