I think this will work for your needs. There is an early termination you can execute by holding the E key on your keyboard.
uploaded as a .txt file since it wont allow a jsx file. simply change the extension to be .jsx
code pasted below as well. you will need to edit the lines in the middle (39-42) for your desired updated swatch
#target illustrator
#targetengine session
var StartFolder = Folder.selectDialog("Pick the Folder containing the Files you want to ColorCorrect")
var FList = scanSubFolders(StartFolder);
var ContentLength = FList.length
var ProgressBarDialog = new Window("palette");
ProgressBarDialog.text = "Color Fixer Progress";
ProgressBarDialog.orientation = "column";
ProgressBarDialog.alignChildren = ["fill", "top"];
ProgressBarDialog.spacing = 10;
ProgressBarDialog.margins = 16;
var progressbar1 = ProgressBarDialog.add("progressbar", undefined, undefined, { name: "progressbar1" });
progressbar1.maxvalue = (ContentLength);
progressbar1.preferredSize.height = 15;
progressbar1.preferredSize.width = 500;
progressbar1.alignment = ["fill", "top"];
var progresstext = ProgressBarDialog.add("statictext", undefined, undefined, { name: "progresstext" });
progresstext.preferredSize.width = 500;
progresstext.alignment = ["fill", "fill"];
ProgressBarDialog.show();
progressbar1.value = 0;
ContentLoop: for (var f = 0; f < ContentLength; f++) {
if (ScriptUI.environment.keyboardState.keyName == "E") {
Canceled = true;
break ContentLoop;
}
progressbar1.value = (f) + 1;
progresstext.text = (f + 1) + "/" + (ContentLength) + " " + decodeURI(File(FList[f]).name) + ": Opening File...";
ProgressBarDialog.update()
/*OPEN THE DOC*/
var ActDoc = app.open(FList[f])
/* MAKE COLOR UPDATES HERE */
var SwatchToUpdate = ActDoc.swatches.getByName('C=40 M=65 Y=70 K=0')
/*uncomment which channels you want to alter. simply delete the 2 slashes preceeding the line
and change the value to be the new intended value */
//SwatchToUpdate.color.spot.color.cyan = 0
//SwatchToUpdate.color.spot.color.magenta = 0
//SwatchToUpdate.color.spot.color.yellow = 0
//SwatchToUpdate.color.spot.color.black = 0
/*SAVE DOC AND CLOSE */
ActDoc.save()
ActDoc.close()
if (ScriptUI.environment.keyboardState.keyName == "E") {
Canceled = true;
break ContentLoop;
}
}
ProgressBarDialog.close()
alert("Done!")
function scanSubFolders(tFolder) { // folder object
var sFolders = new Array();
var allFiles = new Array();
sFolders.push(tFolder);
for (var j = 0; j < sFolders.length; j++) { // loop through folders
var procFiles = sFolders[j].getFiles();
for (var i = 0; i < procFiles.length; i++) { // loop through this folder contents
if (procFiles[i] instanceof File) {
if (procFiles[i].toString().search(/\.ai/i) > 0) {
allFiles.push(procFiles[i]);// if no search mask collect all files
}
} else if (procFiles[i] instanceof Folder) {
sFolders.push(procFiles[i]);// store the subfolder
scanSubFolders(procFiles[i]);// search the subfolder
}
}
}
return allFiles;
};