Add to Each Line on Clipboard?

I have a list of song artists and titles taken from a cleaned-up M3U playlist. I need to turn each item in the list into a link to search Amazon Digital Music for the song, but I don’t know how to do that. Could someone help?

I’ll be starting with a list of 25-30 songs formatted like the following:

Judas Priest - Johnny B. Goode 
Chuck Berry -  Johnny B. Goode 

And I want to finish with:

<a href="">Judas Priest - Johnny B. Goode</a>
<a href="">Chuck Berry -  Johnny B. Goode</a>

So far I have KM copying the entire list to a named clipboard (“Temporary”). I understand that I need to somehow tell KM to process each line of the named clipboard individually, perform the needed replacements and prefixing and suffixing, and then write it back as a solid list to the same Temporary clipboard for pasting. I just don’t know to do any of that.

Does anyone know how to link to iTunes for such a search? I would ideally like to create a list that has an iTunes icon linked to the song there, an Amazon icon linked to the song there, and then the “Artist - Song” name not hyperlinked.

Try this:

[test] Regex for Amazon Link.kmmacros (4.5 KB)

These are my iTunesStore search templates in LB (the asterisk is the query):



Store: Album:


Store: Artist:


Store: Composer:


Store: Song:

1 Like

Tom, you are my hero. Thank you very much!

Your macro worked perfectly, and I was able to add in functioning iTunes links, too because of your examples. This is for my new streaming Internet radio show/podcast at, by the way.

A previous macro sets the Temporary clipboard with a cleaned up list from the M3U playlist.

Here's what I ended up with.

HHH Playlist Buy Now Links.kmmacros (6.1 KB)

Great! Thanks to your link I’ve learned that my little Bluetooth speaker has something like bass :laughing: