I have a script that changes RGB colours to specific CMYK values but in my Indesign file I end up with 2 CMYK values is
c=0, m=100, y=0, k=0 and c=0, m=100, y=0, k=0_2 How do i get these to merge so i only have one swatch c=0, m=100, y=0, k=0. Has anyone got any ideas? or have another script?
This is the script i have at the moment which changes the RGB to the specific CMYK.
var myIDOc = app.activeDocument;
var mySwatch = myIDOc.swatches;
for (var j=4; j<mySwatch.length; j++){
try{
if(mySwatch[j].space==ColorSpace.RGB){
if(mySwatch[j].name==“Word_R122_G75_B153”){// may be this is correct you can check the indesign swatches name
mySwatch[j].model=ColorModel.PROCESS;
mySwatch[j].space=ColorSpace.CMYK;
var myCV = mySwatch[j].colorValue=[48,72,0,0];
mySwatch[j].name= “C=48 M=72 Y=0 K=0_1”
}
}
}catch(e){alert(e)}
}
var myIDOc = app.activeDocument;
var mySwatch = myIDOc.swatches;
for (var j=4; j<mySwatch.length; j++){
try{
if(mySwatch[j].space ==ColorSpace.RGB){
if(mySwatch[j].name==“Word_R255_G255_B255”){// may be this is correct you can check the indesign swatches name
mySwatch[j].model=ColorModel.PROCESS;
mySwatch[j].space = ColorSpace.CMYK;
var myCV = mySwatch[j].colorValue=[0,0,0,0];
mySwatch[j].name= “C=0 M=0 Y=0 K=0”
}
}
}catch(e){alert(e)}
}
var myIDOc = app.activeDocument;
var mySwatch = myIDOc.swatches;
for (var j=4; j<mySwatch.length; j++){
try{
if(mySwatch[j].space ==ColorSpace.RGB){
if(mySwatch[j].name==“Word_R0_G0_B0”){// may be this is correct you can check the indesign swatches name
mySwatch[j].model=ColorModel.PROCESS;
mySwatch[j].space = ColorSpace.CMYK;
var myCV = mySwatch[j].colorValue=[0,0,0,100];
mySwatch[j].name= “C=0 M=0 Y=0 K=100_1”
}
}
}catch(e){alert(e)}
}
var myIDOc = app.activeDocument;
var mySwatch = myIDOc.swatches;
for (var j=4; j<mySwatch.length; j++){
try{
if(mySwatch[j].space ==ColorSpace.RGB){
if(mySwatch[j].name==“Word_R0_G0_B255”){// may be this is correct you can check the indesign swatches name
mySwatch[j].model=ColorModel.PROCESS;
mySwatch[j].space = ColorSpace.CMYK;
var myCV = mySwatch[j].colorValue=[100,0,0,0];
mySwatch[j].name= “C=100 M=0 Y=0 K=0_1”
}
}
}catch(e){alert(e)}
}
var myIDOc = app.activeDocument;
var mySwatch = myIDOc.swatches;
for (var j=4; j<mySwatch.length; j++){
try{
if(mySwatch[j].space ==ColorSpace.RGB){
if(mySwatch[j].name==“Word_R255_G0_B255”){// may be this is correct you can check the indesign swatches name
mySwatch[j].model=ColorModel.PROCESS;
mySwatch[j].space = ColorSpace.CMYK;
var myCV = mySwatch[j].colorValue=[0,100,0,0];
mySwatch[j].name= “C=0 M=100 Y=0 K=0_1”
}
}
}catch(e){alert(e)}
}
var myIDOc = app.activeDocument;
var mySwatch = myIDOc.swatches;
for (var j=4; j<mySwatch.length; j++){
try{
if(mySwatch[j].space ==ColorSpace.RGB){
if(mySwatch[j].name==“Word_R132_G71_B255”){// may be this is correct you can check the indesign swatches name
mySwatch[j].model=ColorModel.PROCESS;
mySwatch[j].space = ColorSpace.CMYK;
var myCV = mySwatch[j].colorValue=[48,72,0,0];
mySwatch[j].name= “C=48 M=72 Y=0 K=0_2”
}
}
}catch(e){alert(e)}
}
var myIDOc = app.activeDocument;
var mySwatch = myIDOc.swatches;
for (var j=4; j<mySwatch.length; j++){
try{
if(mySwatch[j].space ==ColorSpace.RGB){
if(mySwatch[j].name==“Word_R234_G229_B255”){// may be this is correct you can check the indesign swatches name
mySwatch[j].model=ColorModel.PROCESS;
mySwatch[j].space = ColorSpace.CMYK;
var myCV = mySwatch[j].colorValue=[8,10,0,0];
mySwatch[j].name= “C=8 M=10 Y=0 K=0_1”
}
}
}catch(e){alert(e)}
}
Thanks