2

I was hoping someone could help me figure out a solution to my current problem. I have 16 Artboards with the same shape in each. I need to give each shape in each of artboard a specific RGB Hex value/color per. I tried to record an action but it didn't seem to recognize that I was selecting all items in each different artboard, so it applied the actions in unison to the first artboard. Is this easily achievable somehow?

  • Select all items in Artboard1, Apply Color RGB #E42313,
  • Select all items in Artboard2, Apply Color RGB #F28C00,
  • Select all items in Artboard3, Apply Color RGB #FAB72E,
  • Select all items in Artboard4, Apply Color RGB #FFE700,
  • Select all items in Artboard5, Apply Color RGB #C0D886,
  • Select all items in Artboard6, Apply Color RGB #04A64B,
  • Select all items in Artboard7, Apply Color RGB #3F6F60,
  • Select all items in Artboard8, Apply Color RGB #008996,
  • Select all items in Artboard9, Apply Color RGB #0070BA,
  • Select all items in Artboard10, Apply Color RGB #002D59,
  • Select all items in Artboard11, Apply Color RGB #990A2C,
  • Select all items in Artboard12, Apply Color RGB #522583,
  • Select all items in Artboard13, Apply Color RGB #D1467E,
  • Select all items in Artboard14, Apply Color RGB #EDEDED,
  • Select all items in Artboard15, Apply Color RGB #020100,
  • Select all items in Artboard16, Apply Color RGB #935200

enter image description here

3
  • Did you try: Select>> All on active artboards ? Ctrl + Shit + A.
    – LeoNas
    Commented Jun 7, 2018 at 19:59
  • @LeoNas This doesn't work because there is no way to have an action shift to selecting each artboard inturn. Commented Jun 7, 2018 at 20:13
  • Yeah, you're right. Unfortunatelly there is no shortcut to do it, and we can't create one to select an artboard.
    – LeoNas
    Commented Jun 7, 2018 at 20:15

2 Answers 2

2

I'm assuming that you want this to work with another set of icons that you will run this action on.

What I did to make it was to create a new swatch group and make individual swatches for each color. Then while recording I clicked on each item and applied the corresponding swatch. Then I stopped recording. After that, I recorded select All on Active Artboard and then I used the select Next Object Above (might be below depending on your ordering) and then after doing this for all remaining 15 objects, I ordered the selection above the corresponding swatch application.

NOTE: This will not work unless the swatch group is present in the document and all the elements aren't on the same layer

Here is the link to the action.

enter image description here


One of the key takeaways from this is you can't always do what you want to happen in one go. First I had to make the swatches, then I had to get the apply command for each, then I had to get the selections. Only after could I then rearrange all the elements to work as a final result.

4
  • 404 Page not found.
    – LeoNas
    Commented Jun 7, 2018 at 20:09
  • @LeoNas Uploaded it to a new host. Commented Jun 7, 2018 at 20:12
  • 1
    This is exactly what I am trying to achieve, yes we have hundreds of product sky's with all various shapes/profiles. We have 16 material colors so I have to create a file for each color material for every product sku. This will save me a lot of time if I can get it to execute! Thanks, I'll be in touch! Commented Jun 7, 2018 at 20:29
  • This works flawlessly for my setup, thanks a ton! this helps me immensely, Thank you, Thank you! Commented Jun 8, 2018 at 12:43
0

These are all great ways to achieve my end goal and I can't thank you all enough. As I quickly lay these pieces out on the various dartboards as there is usually stock artwork that goes on each piece. Some colors require different imprint/art colors for contrast.

I was sent this script and it does exactly what I need once I setup my art. Thanks for all your suggestions, I can't say thank you enough!

(function () {  
var colorParams = ['E42313', 'F28C00', 'FAB72E', 'FFE700', 'C0D886', '04A64B', '3F6F60', '008996', '0070BA', '002D59', '990A2C', '522583', 'D1467E', 'EDEDED', '020100', '935200'],  
    rgbColors = [],  
    doc = app.activeDocument,  
    artBoards = doc.artboards,  
    i,  
    max;  

function getRGBColor(param) {  
    var result = param.match(/.{2}/g),  
        rgb = new RGBColor();  
    rgb.red = parseInt(result[0], 16);  
    rgb.green = parseInt(result[1], 16);  
    rgb.blue = parseInt(result[2], 16);  
    return rgb;  
}  

function fill(sel, color) {  
    var i,  
        max;  
    for (i = 0, max = sel.length; i < max; i += 1) {  
        sel[i].fillColor = color;  
    }  
}  

for (i = 0, max = colorParams.length; i < max; i += 1) {  
    rgbColors.push(getRGBColor(colorParams[i]));  
}  

for (i = 0, max = artBoards.length; i < max; i += 1) {  
    artBoards.setActiveArtboardIndex(i);  
    doc.selection = null;  
    doc.selectObjectsOnActiveArtboard();  
    fill(doc.selection, rgbColors[i]);  
}
}());

Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.