How do I color an entire layer?

G'day.
I'm new to scripting illustrator, and I'd like to be able to set the color of everything on a layer to red ( or any other color). Is it possible?
I've tried selecting all with the GUI, and setting the default stroke color while the layer is selected, but that process adds extra width to the image parts, and only works on some parts.
Regards
Brian

The above JavaScript actually loops thru page items not path items (unless you only have path items on the page)
You did not state any particular language to do this in but were using AppleScript in another post (I think) so here's something that should get you started. This is only for path items only but you could include other elements of your layer.
BTW in the GUI you could just draw a big rectangle behind all your layer items then select all and 'make opacity mask'
I can't get this to work in script even by calling on an action.
tell application "Adobe Illustrator"
activate
set Doc_Ref to the current document
tell Doc_Ref
set Swatch_Ref to index of swatch named "Mars Red"
-- See if we have used global color for tints
if class of color of swatch Swatch_Ref = spot color info then
set Global_Color to true
else
set Global_Color to false
end if
repeat with i from 1 to count of path items of layer "Marks"
set This_Path_Item to path item i of layer "Marks"
if filled of This_Path_Item = true then
-- See if we have used global color for tints
if class of fill color of This_Path_Item = spot color info and Global_Color = true then
set This_Fill_Tint to tint of fill color of This_Path_Item
set fill color of This_Path_Item to color of swatch Swatch_Ref
set tint of fill color of This_Path_Item to This_Fill_Tint
else
set fill color of This_Path_Item to color of swatch Swatch_Ref
end if
end if
if stroked of This_Path_Item = true then
-- See if we have used global color for tints
if class of stroke color of This_Path_Item = spot color info and Global_Color = true then
set This_Stroke_Tint to tint of stroke color of This_Path_Item
set stroke color of This_Path_Item to color of swatch Swatch_Ref
set tint of stroke color of This_Path_Item to This_Stroke_Tint
else
set stroke color of This_Path_Item to color of swatch Swatch_Ref
end if
end if
end repeat
end tell
end tell

Similar Messages

  • Color filling entire layer & not object?

    Hello:                                                                                                               Level: Newbie  OS: Win7 64bit  Ps: Cs6
    I am trying to follow this tutorial ... http://rgbjam.com/tutorials/creating-a-pencil-in-photoshop
    Under #2 ... I am assuming the author means to draw with the Rounded Rectangle in Path mode ... am I assuming correct? I think it is suppose to be set to Path b/c it's the only way the Blend Mode reads "Pass Through"
    this tuts steps aren't really numbered well but also under step two where the "BG" is filled with black the resulting shape is suppose to look like this :
    But mine looks like this :
    Notice how the left side has a lighter grey color and the one from the tut above is clear? Can anyone tell me why this would be?
    Okay, here is my real problem ...
    Also under step #2 ... where it comes to the part where I am to color the resulting shape with a yellow gradient this is what happens to me :
    the entire canvas becomes colored ... ??
    Here are my Layers.
    I select the "BG" layer to apply the gradient.
    Here is the Layers panel from the tut which is confusing to me b/c the only difference I see is that the tuts panel has the down arrow and folder of the top layer/the "Body" layer seems to be greyed out... and the tut says something like : Activate the "BG" layer and cancel the mask view. Well, I have no idea how to go about canceling the mask view and I looked all over Ps for such an "action" and also throughout the online manual.
    Sorry for such a long post. I hope I gave enough information. If you need any more info to help me work this out please just let me know.
    I really appreciate your time and efforts. Hope all is well with you and that the holiday season (if you celebrate) is going well for you.

    Hola SeniorSSS ...   
    Thank you so very much for all of your amazing help! I really appreciate the attention to detail.
    I'm in a hurry right now but as soon as I return home I plan to start the tut all over again and I will use your advice.
    You're English is fine i just appreciate your time and efforts. By the way, is your first language Spanish? I am guessing because of your screen name.
    R_Kelly ~ goodness I messed the entire tut up ... lol ... thank you for your advice and pointers too!! I really had no idea that I used a Vector Mask and not a pixel mask.
    Actually, I've only known about a Layer Mask and Vector until now and so I plan to go read about it more in the manual. Hope I find some good info there b/c I don't always have good luck finding stuff ... and so thank goodness for this forum !!
    I'll be back later to let you both know how things pan out for me.
    Thanx again for everything!!

  • How do i make an entire layer linkable?

    Hello guys
    I have a very big animation with around 33 layers. Each layer goes on for around 50frames (using 10FPS) and they all have different content.
    I would like to add a link to each layer, but so far i've only sucedeed in linking a single frame in each layer... Would like to know if it's possible to make the entire duration of the layer linkable.
    Also, since there are so many layers, is it possible to make buttons that on click jump to the next/previous layer?
    Ty in advance

    Layers are not Flash objects so you cannot link them.  You can link what they contain.  If you want to li8nk all of what is in a layer then you need to create it as a movieclip wherein the 50 frames it is comprised of are internal to the movieclip, on the movieclip's timeline.
    I don't know what you mean as far as wanting to be able to have buttons that bring you from one layer to another.  Layers are parallel entities so if you are in a timeline, you are in all of its layers simultaneously

  • How do I mark the entire contents of a RichTextBox (gRTbxInfo) with a background color of white?

    How do I mark the entire contents of a RichTextBox (gRTbxInfo) with a background color of white?
    I have code that finds / marks words with a different color.  Now I want to remove that color.  I've started with the following, but cannot complete it.
        //int iLength = gRTbxInfo.Length
        int iLength = 10;
        TextRange trText = new TextRange(gRTbxInfo.Document.ContentStart, gRTbxInfo.Document.ContentEnd);
        TextPointer tpStart = trText.Start.GetInsertionPosition(LogicalDirection.Forward);
        TextPointer tpSelectionStart = tpStart.GetPositionAtOffset(0, LogicalDirection.Forward);
        TextPointer tpSelectionEnd = tpSelectionStart.GetPositionAtOffset(iLength, LogicalDirection.Forward);
        TextRange tpSelection = new TextRange(tpSelectionStart, tpSelectionEnd);
        tpSelection.ApplyPropertyValue(TextElement.BackgroundProperty, new SolidColorBrush(Colors.White));
    bhs67

    Isn't that just
    TextRange tr = new TextRange(rtb.Document.ContentStart, rtb.Document.ContentEnd);
    tr.ApplyPropertyValue(TextElement.BackgroundProperty, Brushes.White);
    Hope that helps.
    Recent Technet articles: Property List Editing;
    Dynamic XAML

  • Is it possible to change the color of a layer of a Customs CSS from an External Style sheet?

    Hi,
    I have sucessfully link External .css  file to my HTML page and able to change the font size of the headlines and the paragraph.
    What I am not able to do is to ADD the color my Custom CSS from the External sheet.  I have difined the color attribute as a 'Advance'
    and gave it the same name "#bigwraper" that is has in my HTML file.
    Attached is the color outline of my 'Blank Layout' with colors?
    Thank you.
    Dreamer101.1

    Hi Murray,
    I am building a web site on which the entire content would be changed at least daily. The website would have similar design to www.Helium.com
    The page will have CCS layout boxes in which different content would  be pasted.
    To re-phrase my question:  I want to know how to change the color of a layer from an external style sheet?
    Because my home page 'Sidebar' and colors would be the same for all page, only the content of different pages would be different.  If I want to change a color of my web side pages, I need to learn how to do it in one spot through an External Style Sheet.
    I am amble to link my external style sheet and to change H1 tag and to give it different colors. But I was not sucess with change the color of a layer on which my content sits around.
    I took out the color from my HTML page and gave the same name to the layer in my External Style Sheet with the same color.
    Hope my question and the reason I was able to clarify.
    cheers,
    Dreamer101.1

  • How to change colors of individual column bar in the same data series

    in mac numbers, how to change colors of individual column bar in the same data series. The entire column series gets selected in the column bars and cannot select to change colors of specifc bars.

    Hi Kiran,
    no its not possible through Theme editor also ,because these colors are coming from Compiler which u are using.
    Regards,
    Govindu

  • Quick Tip - Color Lookup Adjustment Layer in Photoshop CS6 | The Complete Picture with Julieanne Kost | Adobe TV

    In this Quick Tip, Julieanne demonstrates the new Color Lookup Adjustment layer and walks you through how to download a template to quickly apply these new “looks” to your images. The files she references can be found here. http://adobe.ly/Ng3afA
    http://adobe.ly/LiGadT

    Can the Camera Calibration tech. in LR be used to keep IR raw images looking like the jogs on back of camera?

  • In Aperture, how do you put a background layer behind text?

    How do you put a background layer behind the text to offset the color of the pic from the text color? Right now, some pics have whites and blacks that drown out the text, making it hard to read...

    I forgot: if you rather want to add a background instead of changing the color of your text:
    To add a background behind a texbox,
    simply edit the layout (Click "Edit Layout", click "+") and add a Photo Box;
    drag the PhotoBox behind your text field.
    click "edit content" and add a picture to the background box.
    You'll need to import a suitable background photo, or crop some suitable background from one of your images.
    Regards
    Léonie

  • How to get info from a layer which is  applied  with styles  ?

    How to get info from a  layer  ?  such  as   (  apply  style  or  not , which  effect  have  applied  on  it  etc..)
    I  really  can't  solve  it , Who can hlep me..  By the way , I 'am  using  CS version.  

    xtools/xlib/Styles.js has a set of functions for working with layer styles. I do not know if it works with CS. I wrote it several years ago for either CS or CS2. If this doesn't work, then nothing will. The script retrieves a layer's style by saving it to disk then parsing the file for the desired ActionDescriptor.
    There is a function at the bottom of the file that tests the Styles.js API.
    Styles.test = function() {  var doc = app.activeDocument;
      var layer0 = doc.artLayers[0];
      var gdesc = Styles.getLayerStyleDescriptor(doc, layer0);
      if (!gdesc) {
        alert("There is no layer style associated with the layer");
        return;
    //   this will set the layer style to another layer.
    //   var layer1 = doc.artLayers[1];
    //   Styles.setLayerStyleDescriptor(doc, layer1, gdesc);
      if (!gdesc.hasKey(cTID('FrFX'))) {  // look for a stroke effect
        return;
      var frfx = gdesc.getObjectValue(cTID('FrFX'));
      if (!frfx.hasKey(cTID('Clr '))) {   // look for the color
        return;
      var clr = frfx.getObjectValue(cTID('Clr '));
      // we should really check that the objectType is RGBC
      var r = clr.getDouble(cTID('Rd  '));
      var g = clr.getDouble(cTID('Grn '));
      var b = clr.getDouble(cTID('Bl  '));
      if (r == 0 && g == 0xFF && b == 0xFF) {
        return;
      clr.putDouble(cTID('Rd  '), 0);
      clr.putDouble(cTID('Grn '), 0xFF);
      clr.putDouble(cTID('Bl  '), 0xFF);
      frfx.putObject(cTID('Clr '), cTID('RGBC'), clr);
      gdesc.putObject(cTID('FrFX'), cTID('FrFX'), frfx);
      Styles.setLayerStyleDescriptor(doc, layer0, gdesc);

  • Color balance adjustment layer opening as levels

    When I try creating a color balance adjustment layer is it opening a levels adjustment layer. I'm using the New Adjustment Layer button at the bottom of the Layers panel. Is this a bug with CS6? How can I fix the problem?

    This is the process that I go through:
    Selecting the adjustment icon at the bottom of the Layers Panel, as shown below.
    I select color balance, as shown below.
    The properties panel is brought up, and shows the color balance adjustment controls.
    In your properties panel, are your saying when you follow the above, that level adjustments come up?
    Janelle

  • Selecting Color Balance adjustment layer brings up Levels adjustment layer

    Ok, so, all of a sudden I cannot get a color balance adjustment layer to come up. Every time I do photoshop creates a levels layer. Selecting levels makes a levels layer. All of the other adjustment layers seem to be working normally. How do I fix this? I have a deadline and no time to be reinstalling photoshop.

    Reinstalling the application seldom helps, and re-installing without trashing your preferences is futile as you end up right where you started.
    I understand your frustrartion, but please remember that you are not addressing Adobe here in this user to user forum.
    http://forums.adobe.com/thread/419981?tstart=0
    Excerpt from that link:
    • Do not be abusive or aggressive in your tone
    An aggressive or abusive sounding post will often evoke an aggressive or abusive and unhelpful reply
    Remember, you are requesting help from other users, just like you, who are giving their time free of charge. No one is under any obligation to answer your question.
    Thanks!

  • Color Balance Adj Layer Characteristics Changed from CS4- CS5?

    Maybe some guru with better connections to Adobe knows the answer to this. (or maybe I just forgot).
    I just discovered (and I don't think it is pilot error) that the characteristic behavior of the Color Balance Adjustment Layer is different in CS5 than it was in CS4/CS3.  (Much stronger in CS4/CS3).
    In addition, there is also an associated behavior that is like a buried legacy mode that is not made visible to the user.  Here is what I mean.
    If I create an image in CS4  with a single Color Balance Adj Layer, I get an adjusted image.
    If I open that same PSD file in CS5, the same image is displayed.
    If I use the same base image, yet create the Color Balance Adj Layer from within CS5, the adjusted image is different than the prior two.   So the Color Adjustment Layer acts like it has a hidden legacy mode where the characteristics are one type if created in CS4/CS3 yet a different characteristic if created in CS5.
    My mind might be slipping (or my cold has the better of me) because I do not remember this as a documented change and I searched the internet for "What's new in CS5" etc etc.  I don't remember anything on other forums about this either.
    I guess the good news is, the new characteristic of the Color Balance Adjustment Layer is better behaved with a transfer curve with less clipping for highlights and shadows.  Very similar to the better behavior of the change of the Brightness/Contrast Adjustment Layer going from CS2 to CS3.
    Here are some comparison images.
    This is the Layer Stack Used with Base Image of simple B to W gradient with CB Layer on top with just the highlights pegged to red.  This is the exact same Layer Stack for all of the images shown:
    Here is the first image.  This was created in PS CS4 and displayed from CS4 with the conditions show above:
    This is the same image from above that was saved as PSD with profile and them imported to PS CS5 with same profile.  There was no change:
    This next image is using the same base gradient, yet then creating the CB Layer from within PS CS5 with the same parameters, only the Red pegged for the Highlights:
    Does someone have an easy answer for this.  Can someone duplicate this and confirm the change from CS4 to CS5.  A test by someone else would either confirm I am off base with pilot error or there is something to this.
    And yes, all the images were sRGB and kept in sRGB for creation/display.  All Screenshot images were the images brought up side by side on the same color managed monitor.   All Edit > Color Settings were identical.
    Thanks in advance for any help
    John

    OK, Chris, but before I perform my act of self flaggelation for the benefit for all and my extra embarrassment, let me add in some useful information about the Color Balance Adj Layer that could be helpful.
    I was working with another individual who wanted a better understanding the color balance adj layer, what is was exactly doing, how the shadows, midtones, and highlights interacted, and the differences with preserve luminosity checked or not, and also why the preserve luminosity was so hard to predict (e.g. did not really preserve luminoisty).
    Without going into the deails of all of that, the tidbit I will leave as far as penance for my stupid original post above is that the Color Balance Adj Layer with the Preserve Luminosity box checked does a reasonable job or preserving luminoisty for the midtone adjustments yet definitely does not for the shadow and highlight adjustments.
    An easy workaround for this is to just set the Color Balance Adj Layer Blend to Color which preserves Luminosity of the image presented from lower layers while maintaining the Color as best it can from using the CB Adj Layer  (It holds the Hue and does its best to keep the same Saturation yet the Luminoisty from the presented image from lower layers takes prescendence).  This does a much better job at preserving Luminosity than using the checkbox option.    I usually use this approach and keep the Preserve Luminiosity box turned off.
    The error that I made was during the fairly involved exchange with this other individual, at some point I accidentally set the Layer Mask for the CB Adj Layer to 50% gray and did not notice that it had changed from the default white.  Much further down the line, when this other individual could not exactly recreate my results, he mentioned working in CS3. Thinking this odd,  I pulled up CS3, created the image from scratch (without the erroneous mask change to 50% gray) so therefore I duplicated his results and did not realize the error was in my original Layer Stack.  To make a long story short, I went and checked for differences in all system settings, profiles, Color Settings, opacity settings, Blend settings, Layer Style settings (and their options) etc, etc and overlooked a change in the Mask gray level.        When I quickly flashed back and forth between the two documents/stack it finally popped out at me. Mea Culpa.

  • How do I get the Photoshop layer tags in JavaScript?

    I asked this question at graphic design stack exchange but they pointed me here:
    http://graphicdesign.stackexchange.com/questions/35374/how-do-i-get-the-photoshop-layer-ta gs-in-javascript?noredirect=1#comment48962_35374
    I want to do actions based on the tagged layer color (these thing 1) in Photoshop. I can't find a property inside the JavaScript documentation or the ExtendScript Toolkit that might contain the value.
    I'd prefer not to abuse the name for that, the layer tags look like a very clean solution to my problem. If only I could fetch them.
    Any Ideas?
    Kind Regards,
    Mii

    Hi, these functions will select all your layers with the specified color:
    use the command: selectAllByColor("red");
    function getIDXwithsameColor(TheColor){// search and return a list of indexes for the layers with the specified color
        var ref = new ActionReference();
        var toRet = [];
        try{activeDocument.backgroundLayer;var a=0 }catch(e){ var a = 1; };
        while(true){
          ref = new ActionReference();
          ref.putIndex( charIDToTypeID( 'Lyr ' ), a );
          try{var desc = executeActionGet(ref);}catch(err){break;}
            var cl = desc.getEnumerationValue(charIDToTypeID("Clr "));
            cl = typeIDToStringID(cl);
            var ls = desc.getEnumerationValue(stringIDToTypeID("layerSection"));
            ls = typeIDToStringID(ls);
            if(ls != 'layerSectionEnd'){
              if(cl == TheColor){
                toRet.push(a);
          a++;
        return toRet;
    function multiSelectByIDX(idx) {// selection function
      if( idx.constructor != Array ) idx = [ idx ];
        var layers = new Array();
        var desc = new ActionDescriptor();
        var ref = new ActionReference();
        for (var i = 0; i < idx.length; i++) {
              layers[i] = charIDToTypeID( "Lyr " );
              ref.putIndex(layers[i], idx[i]);
        desc.putReference( charIDToTypeID( "null" ), ref );
        executeAction( charIDToTypeID( "slct" ), desc, DialogModes.NO );
    function selectAllByColor(TheColor){// main function
      theSameClIDX = getIDXwithsameColor(TheColor);
      multiSelectByIDX(theSameClIDX);
    //...example::
    // selectAllByColor("none");
    //selectAllByColor("red");
    // selectAllByColor("orange");
    // selectAllByColor("yellowColor");
    // selectAllByColor("grain");
    // selectAllByColor("blue");
    // selectAllByColor("violet");
    // selectAllByColor("gray");

  • How to use Color Splash Effect in Photoshop CS6?

    Hi everyone
    Can you guy help me out How to use Color Splash Effect in Photoshop CS6? I need to use in slide in my web
    Thanks

    You mean "leave part in color and make the rest black and white"?
    Just select or mask the part that should be B&W and desaturate, or use the B&W adjustment.
    Or you can add a B&W adjustment layer and mask out the parts that should stay in color.

  • Adding Color to a Layer

    I am currently trying to make a before-and-after presentation in CS4. I have 2 pictures that are side-by-side (via Image-->Reveal All). At the moment I have 2 layers, and when I try to add color to a layer, both pictures become black. For dramatic effect, I want to put a black line between the 2 images. How do I do that?
    Thanks!

    One way might be to unlock the background layer before doing Reveal All so
    the areas not covered by the photos are transparent.
    Then put a blank layer at the bottom of the layer stack, make a selection of the
    area between the two images and fill the selection with black.
    MTSTUNER

Maybe you are looking for

  • Danish iPhone 4 can't connect to a carrier in the UK

    Strange, never had this problem in 2 years with the same iPhone 4. I landed in the UK yesterday and swirtched off flight mode but it won't connect to a carrier. I tried switching off automatic and it then found five networks but if I select any one o

  • PO Validity Date

    Hello The requirment is once the PO validity date is over, then system should not allow any GR or IV against the PO. Is their any std SAP message which can control this. Regards Niti Narayan

  • NWA template installer required for remote systems

    We've installed a NW 7.0 SP13 Java System that will be used for MDM Enrichment.  During the installation we specified the Central SLD (a different NW7.0) system when prompted.  I can see this new system in our Central SLD under the "technical systems

  • Numbers document not synchronized via iCloud

    I am saving document from Numbers MacMini but it's not visible from iOS devices or via iCloud.com. Instead I see the old version of the same document. When I am opening it in MacMini I see it in iCloud area, but in iCloud.com it shows the old version

  • Internal Error while launch Service Browser

    Hi Dear Experts, I installed the CE 7.1 trial edition, developed a application and tried to test it. After I click the service browser in test tool, following error was happened: Root Cause The initial exception that caused the request to fail, was: