Copy link to clipboard
Copied
Hello, I have a dynamic symbol.and I want to change the color of one shape. This can be done using direct selection tool. But I need to do with a script. Its urgent. I there any way to do that?? Thanks in advance.
Copy link to clipboard
Copied
The first thought: disassemble a symbol, then change a color of one shape, and then assemble back. Recently, a similar theme I've seen on rudtp.
It seems to me it is not so simple. This requires CS6+. Perhaps in the script will have to load and run the Action.
Copy link to clipboard
Copied
Yes we are using CC version. If you can help more then it will be great help.
Copy link to clipboard
Copied
Hi Marat!
The good news is that as opposed to static symbols, a dynamic symbol's contents can be actually accessed via the color-selection menu commands! If you can know what the starting color is on the target shape within the dynamic symbol, you can use those color-selection commands to achieve your desired goal with ease:
#target illustrator
function test(){
var doc = app.activeDocument
doc.defaultFillColor = doc.swatches.getByName("Color_1").color;
app.executeMenuCommand("Find Fill Color menu item");
doc.defaultFillColor = doc.swatches.getByName("Color_2").color;
};
test();
Convenient, if you're able to use the starting color.
Copy link to clipboard
Copied
Thanks, this is helpful but does not serve our purpose. It may possible that many parts have same color but we want to change color of single part.
Copy link to clipboard
Copied
Okay let's step back- imagine that it's not even a dynamic symbol but a regular group - by which criteria are you wanting to isolate your desired shape? Maybe you can show with screenshot?
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more