Copy link to clipboard
Copied
Hello community! I have around 600 files that I need to change the colors from dark green/light green to dark blue/light blue and I need a script for that. There are some simple letters divided in half and all I need is the upper part to be dark blue instead of the dark green and the lower part to be light blue instead of the original light green. Is this possible? I'm using windows 10 as my operating system. Any help is much appreciated!
Regards,
David.
This code will have you select a folder and then loop through all the files with .EPS file extensions.
Note that this script assumes that all of the colors are exactly the same two greens as in that example file you sent.
You will need to replace the RGB values for the top colors in the lines marked "<- Here" with the values for the new blue colors.
...function ConvertColors() {
/* REPLACE THESE RGB VALUES */
var topColor = new RGBColor();
topColor.red = 0; // <- HERE
topColor.g
Copy link to clipboard
Copied
Hi DavidTiberiu​,
how the letter is divided in half?
The letter still a letter is? Or it's more a (two) path(s) (compound paths) ?
The new colors already exists in the documents?
Do you have an example file for us?
Copy link to clipboard
Copied
Anything is possible (almost) if you put your mind to it! Now attach an example file and let's see what you got!
Copy link to clipboard
Copied
Here is an example
Copy link to clipboard
Copied
And now this is a shape not a letter anymore, sorry for being so confusing with my original message. The main idea is that I want the top dark green to be a dark blue #2E3192 and the bottom part to be a light blue #29ABE2 also the "Company name" to be same dark blue #2E3192 . Thank you so much!
Copy link to clipboard
Copied
This could be easy or difficult, because of: there are more elements with the same color exists.
The main question is: how to identify the elements to changing? Always on the top or at an several layer or, or or …
And: Do you have an example file (and not an example picture) ?
Copy link to clipboard
Copied
Sure, i've attached the file below
Copy link to clipboard
Copied
Is this something that can be done? Or at least to brake it down in 2 scripts, or in some way that will make my job easy somehow...Thank you so much for you help community, really appreciate all your answers until now!
Copy link to clipboard
Copied
Is there a fix rule to indentify the items which should be recolored? I dont' think. IMHO are different path types with different numbers of items.
One possible way: Recolor all green items (paths, compound paths and group items) to blue and all light green items to light blue.
Copy link to clipboard
Copied
This code will have you select a folder and then loop through all the files with .EPS file extensions.
Note that this script assumes that all of the colors are exactly the same two greens as in that example file you sent.
You will need to replace the RGB values for the top colors in the lines marked "<- Here" with the values for the new blue colors.
function ConvertColors() {
/* REPLACE THESE RGB VALUES */
var topColor = new RGBColor();
topColor.red = 0; // <- HERE
topColor.green = 0; // <- HERE
topColor.blue = 255; // <-HERE
var bottomColor = new RGBColor();
bottomColor.red = 255; // <- HERE
bottomColor.green = 0; // <- HERE
bottomColor.blue = 0; // <- HERE
/* ~~~~~~~~~~~~~~~~~~~ */
// we'll just use the Red value of the top to identify which color we have
var oldTopColor = 140;
var dir = Folder.selectDialog("Where?");
var files = dir.getFiles("*.eps");
// loop through all the files in the selected directory
for(var f = 0; f < files.length; f++){
var doc = app.open(files
);
// loop through all paths and change the colors based on current fill
var paths = doc.pathItems;
for( var i = 0, ii = paths.length; i < ii; i++ ) {
var curPath = paths;
// check the fill color to see if it has the same Red value as the old top color
if( curPath.fillColor.red == oldTopColor ) {
curPath.fillColor = topColor;
}
// if not it must be the bottom color
else {
curPath.fillColor = bottomColor;
}
}
// close and save the changes
doc.close(SaveOptions.SAVECHANGES);
}
}
ConvertColors();
Hope this helps!
Copy link to clipboard
Copied
It worked! I LOVE YOU! Really, you saved me!!!! A million times thank you!!!!!
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more