> ## Content Index
> Fetch the complete content index at: https://www.workroom-productions.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Add Commas
- URL: https://www.workroom-productions.com/add-commas/
- Published: 2025-11-27T20:52:45.000Z
- Updated: 2025-11-27T20:52:45.000Z
- Description: A bookmarklet to add commas to every line in your clipboard.
- Author: James Lyndsay
- Tags: tiny tool

This [tiny tool](https://www.workroom-productions.com/tag/tiny-tool/) adds commas to every line on your list. It's a bookmarklet, and takes advantage of your browser's permissions to go to work on your clipboard. 

I made it in response to a need that turned up in our [Crafting Custom Tools](https://www.workroom-productions.com/crafting-custom-tools/) tute at Agile Testing Days 2025\. Did I write it? No, I asked Claude: `Give me a bookmarklet to change the clipboard by adding a comma on the end of every line`, and this is part of what it made. 

Then I noticed that, for *some* text, it adds a newline with a comma in between all lines but the last – and that's because it was looking for `LF` line endings and not coping as well with `CRLF` endings.

Drag the link below to your bookmark bar. Copy a list, hit the bookmarklet, paste the list. 

[add commas](javascript:%28async%28%29=>{let t=await navigator.clipboard.readText%28%29;let n=t.split%28/\r?\n/%29.map%28e=>e.trim%28%29?e.trim%28%29+',':e%29.join%28'\n'%29;await navigator.clipboard.writeText%28n%29;alert%28'Commas added to each line!'%29}%29%28%29) 

Wrinkles: 

- It may ask you for permission the first time you use it with a particular site and browser.
  - On Chrome, I've just answered to "BBC News wants see text and images copies to your clipboard" – so take care what sites you give permission to, and revoke that in the site settings.
  - On Safari I get a miniature modal with just the word `paste` in it, every time.
- It acts invisibly, and I've seen it *just not work* (amusingly, during a demonstration to a room-full of testers at ATD). So it has an alert that tells you it has done something. Edit the alert out if you want.
- I've no idea what circumstances it needs to work: It works on text and an Excel snippet, via Safari, for me. But for rich text, via Firefox, on your machine? That's for you to find out.

There's perhaps more work to do to make thus a transferrable or robust tool. But this is an *ephemeral* tool, and I'd maybe just make a few more, or be conscious as I used it, rather than seek to understand its every wrinkle.

#### The need

One of our participants copied long columns of IDs, and needed them to have commas on the end at the point when they pasted the information into the next thing. 

Bookmarklets can futz with your clipboard, so this seemed a simple option.