Copy link to clipboard
Copied
Hi,
I am working on an automation script to change colors and I am using Symbols to automate a part of the job already.
Short story :
I need to cycle through the existing symbols, select fill colors matching my spot color, change them to another spot. Same with strokes and move on to the next symbol. I thought it would be a matter of using array value in symbolItems but it looks like it won't work. The only solution I found was to break the symbols before but it negates it's time saving and creates more human mistakes.
Long story :
I automate process and clients don't have the same requirements as people withing the enterprise so I automated the task using a mix of symbols and scripts. Works well but now I would like to go one step ahead and automate color changes in the items of the symbols. I got the javascript figured out and I'm able to generate it from a csv file that is automatically filled from a form. That was done before symbols came into place. But now I have to figure out a way to run my script within the symbols without enterring them manually. I can break them but if I do break them any other manual steps over the drawing won't affect the other and will need to be duplicated which lead to many mistakes and time lost.
Basically I want to do a for loop that loops through all the symbols and run my script from within the symbol and move to the next one.
Is there a way to access the content of the symbols? If not I guess I'll have to set a shortcut to that script and tell people to execute the script within every symbols manually.
Thank you for your help!
Copy link to clipboard
Copied
unfortunately no, I don't think we have access to symbol contents.
Copy link to clipboard
Copied
that is unfortunate. Thank you for your time and help.
We will manually enter every symbols and run the script from inside.
Copy link to clipboard
Copied
can you show screenshots of what you're trying to achieve? there might be workarounds
Copy link to clipboard
Copied
Sure
I have built a simulation with shapes because I cannot share publicly the images as they are not my property.
So let's say I have this symbol. It contains a white background, a red circle and a kaki star.
I named the spot color of the background "background", the red is named "circle" and kaki "star". They are all spot colors, in the swatches and symbols are dynamic.
image1
Goal is to use a script that cycle through the symbols and select "background" and replace it by "Pantone 186 C". I haven't found a way to access the content within the dynamic symbols unfortunately. Right now I decided that we'd assign the script to a shortcut and enter manually every symbol to run the script within it. It is time consuming and not very user friendly. It is also very noisy when 3-4 people are doing this kind of job around haha (mouse clicks!).
The main idea behind this is that we have clients using an online website to make their color changes based on templates. It generate a CSV file containing the changes (background;Pantone 186 c) I read this csv with a C# code I wrote and automatically generate a javascript from the information it reads. This javascript automatically make all the changes from the right template. We still need symbols as we add art provided by the client over this template. The reason behind the use of symbols is that we have a client document that contains some information, a production document that contains other information and is different and a production piece that will be printed. We want all of them to be modified together because we used to have items that were forgotten here and there between different versions.
Thanks for your time and valuable inputs.
Copy link to clipboard
Copied
I trust Carlos' answer. I'm just curious if you're using Dynamic or Static symbols?
Carlos, are Dynamic symbols non-scriptable as well?
I use a Dynamic Symbol in a script. This allows me to set a "rounded corner" effect at the symbol level and scale the instances in the script without changing the corner radius. I also can assign a Graphic Style, by script, to change the color of the instance. This works because it's a simple, one path symbol.
Copy link to clipboard
Copied
I answered on the post above with details. I use Dynamic symbols and would like to access objects inside to change colors.
Copy link to clipboard
Copied
This may not be practical, but could you break your symbols into single symbols for each colored element and group the results then edit the symbol instances by assigning an appearance using a script?
Copy link to clipboard
Copied
Hi Ray, manually you could only change symbol instance colors using Dynamic Symbols. With Static Symbols changing colors is not possible (manually).
Using scripting, we don't have access to the elements inside the instance so we can't target them to assign colors. However if we use spot colors, changing color values will automatically update symbol instances, whether they're Dynamic or Static.
Copy link to clipboard
Copied
Thanks for the additional info. Assuming you have more than 1 symbol instance on the artboard, do all instances need to update their background color to the same color? If so, modifying the Spot color values would update all instances on the artboard in cluding the actual symbol in the symbols panel.
Would that work for you?
Copy link to clipboard
Copied
The only issue I can see is that it needs to match the exact name of the color of our printer. Changing the CMYK/RGB value would be great for display. But I would also need to replace the name of the spot and make sure it stays a spot.
Would it automatically change everywhere or would I need to open the symbols to update the colors?
Copy link to clipboard
Copied
Yes changing spot color values will automatically update everywhere that spot is used.
What names need to match? Aren't your spot colors named background, circle, star? Changing color values will leave the name s unchanged. You can change the name if that's what you need though.
Copy link to clipboard
Copied
I tried and the issue is when the client make 2 objects with the same color spot name.
Like in my example if you make star and circle spot colors become "Pantone 186 C" it will create an error when changing the second spot to an existing spot color name.
Would've worked if it wasn't possible for the client to select the same color in multiple parts of the art. But unfortunately we give them total control over the choice of color. Can we select a spot color from the swatch and replace every element associated with it by another color/item from the swatch?
EDIT : I just found out that it can be modified by going in edit-modify colors-redefine colors by predefined presets (not sure about this one I have the software in french due to languages laws) and then I can replace spot colors from there. Would it possible to access this place via scripts?
Copy link to clipboard
Copied
do you have to rename the Spot to match the name used by the User? can't you add a space or some other character to one of the names to make them unique?
I think you refer to the Recolor Panel, no sorry we don't have access to that.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now