Skip to content

Instantly share code, notes, and snippets.

@elmimmo
Last active January 10, 2025 13:26
Show Gist options
  • Save elmimmo/07ce1dabac44315ca726d094398dd074 to your computer and use it in GitHub Desktop.
Save elmimmo/07ce1dabac44315ca726d094398dd074 to your computer and use it in GitHub Desktop.
Adobe InDesign scripts to convert spot ink swatches to process or set them to print as process
// DESCRIPTION: Sets existing spot color inks to print as process.
// Does not affect spot inks added after the script is ran, so rerun if necessary.
// Jorge Hernández Valiñani
#target indesign
(function () {
var doc = app.activeDocument;
var myInks = doc.inks;
var convertedCount = 0;
for (var i = 0; i < myInks.length; i++) {
if (myInks[i].isProcessInk == false) {
myInks[i].convertToProcess = true;
convertedCount++;
}
}
var message = convertedCount > 0
? "Successfully converted " + convertedCount + " spot ink(s) to process colors."
: "No spot inks found to convert. All inks were already process colors.";
alert(message);
}());
// DESCRIPTION: Converts spot color swatches to CMYK
// Jorge Hernández Valiñani
#target indesign
(function () {
var myColors = app.activeDocument.colors;
var convertedCount = 0;
for (var i = 0; i < myColors.length; i++) {
if (myColors[i].model == ColorModel.SPOT) {
myColors[i].properties = {model: ColorModel.PROCESS, space: ColorSpace.CMYK};
convertedCount++;
}
}
var message = convertedCount > 0
? "Successfully converted " + convertedCount + " spot color swatch(es) to CMYK."
: "No spot color swatches found to convert. All swatches were already in CMYK.";
alert(message);
}());
// DESCRIPTION: Converts spot color swatches to process
// Jorge Hernández Valiñani
#target indesign
(function () {
var myColors = app.activeDocument.colors;
var convertedCount = 0;
for (var i = 0; i < myColors.length; i++) {
if (myColors[i].model == ColorModel.SPOT) {
myColors[i].properties = {model: ColorModel.PROCESS};
convertedCount++;
}
}
var message = convertedCount > 0
? "Successfully converted " + convertedCount + " spot color swatch(es) to process colors."
: "No spot color swatches found to convert. All swatches were already process colors.";
alert(message);
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment