Change fill color in all paragraph styles

Script for InDesign CS4 and above.

Changes text color "C=60 M=40 Y=0 K=0" with "C=15 M=100 Y=100 K=0" in all paragraph styles including those in groups.


function Main() {
	var doc = app.activeDocument,
	parStyles = doc.paragraphStyles,
	swatch_1 = doc.swatches.item("C=60 M=40 Y=0 K=0"),
	swatch_2 = doc.swatches.item("C=15 M=100 Y=100 K=0"),
	i, parStyle;
	if (swatch_1.isValid && swatch_2.isValid) {
		for (i = 0; i < parStyles.length; i++) {
			parStyle = parStyles[i];
			if (parStyle.fillColor == swatch_1) parStyle.fillColor = swatch_2;
	else {
		alert("A swatch doesn't exist.");

Download it from here.