Replace all spot colors within a document with swatch library

I have a swatch library of 30 colors that are all spot colors that I would like to replace with another swatch library of the same colors and names but the values that make up the colors are different. Any clue how I would go about this?

Do you want to change the library itself or the colours as they appear in the document?

The colors as they appear in the document.

Hi. Make the effort to do this to at least one color, and the solution will become clear. It’s really just a matter of iterating through a list. Get the four color values that you want and then apply them to the same-named spot. If you get stuck, post your code for evaluation.