JavaScript to determine the color of background/outline named pathItem [index]?

I'm looking to build a control upstream of sorts for my Illustrator workflow (because for some reason... upstream in illustrator does not exist...).

Essentially, I need to loop through the pathItems on each work plan looking for a specific spot color (first check that the task of color does NOT exist as a fill color in one of the work, then check for any pathItem that contains the task of color such as a stroke).

This seemed to be a very simple task, but it seems that pathItems.fillColor or pathItems.strokeColor is not a valid property? Which confuses me because she works to apply a color to a pathItem... It seems to me that if you can apply a color via pathItems.fillColor, you should also be able to create an if clause that determines if pathItems.fillColor is (regardless of color). However, test it in the simplest of documents in which I know what the result of the if clause should be, it does not work. is there something I'm missing here on the fillColor/strokeColor property?

Here's the code I'm working with. Thank you, all.

#target Illustrator




var docRef = app.activeDocument;
var aB = docRef.artboards;
var swatchList = docRef.swatches;
var tC = swatchList.getByName("Thru-cut");
var tCCount = 0; //how many artboards/top level groups contain at least 1 Thru-cut stroke?
var artLayers = docRef.layers;
var groups = artLayers[0].groupItems; 
var aBtCCount = 0; // how many artboards have 
var aBnoTC = []; //  which artboards/top level groups (by index) do not contain at least 1 Thru-cut stroke?


for (a = 0; a < aB.length; a++){
    aBtCCount = 0
    var items = groups[a].pathItems;
    for (b = 0; b < items.length; b ++){
        if (items[b].fillColor == swatchList.getByName("Thru-cut")){
            alert("You have Thru-cut fills in your document!!");
            break;
            } //end if // thru-cut is fill
        else if (items[b].strokeColor == swatchList.getByName("Thru-cut")){
            tCCount++;
            break;
            } //end if // thru-cut is stroke
        else{
            tCCount = 0;
            } //end else // set counter to 0
        }//end for loop B // checking items on each artboard
    if(tCCount == 0){
        aBnoTC.push(" " + a);
        }//end if // artboard has no cut line
    else{
        aBtCCount++;
        }//end else // add to counter for total artboards w/ thru-cut
    alert(tCCount);
        
    }//end for loop A


if (aBtCCount < aB.length){
    alert("Artboard/s " + aBnoTC + " are missing Thru-cut lines");
    }//end if // not enough cut lines
    

Access to the task of color by color background or outline of a path element when it is a spot color is just a little bit more complicated, you've got to go pathItem.fillColor.spot.name.

To see if an undesirable color is found in the document, you can use a more effective method by analyzing the InkList of the document - it has the information you see in the print output dialog box.
alert (document.inkList) will show you the collection of ink plates.

Tags: Illustrator

Similar Questions

  • How to set the color for background ChoiceBox point to ChoiceBox with css?

    How to set the color for background ChoiceBox point to ChoiceBox with css?

    I need to change the backgound color list items.

    I tried with the following code, but it's not help to:

    {.context-menu .choice-box

    -fx-background-color: Red;

    }

    .choice-box .menu-item {}

    -fx-background-color: red;

    }

    In Java 8, either of your selectors should work.

    In Java 7 (JavaFX 2.2), you need of the following workaround:

    #choice-box-menu-item {
         -fx-background-color: red ;
    }
    
  • How can I add change the color of background/first plan the Configurator?

    How can I add change the color of background/first plan the Configurator?

    No matter if you mean the Configurator application or a panel created with Configurator, you would probably have to post the question on the Configurator Forum.

    Configurator

  • How to change from "let indesign determine the color.

    How do I cange "let indesign determine the color" "let printer determine colors? in the print window, I can choose only "let indesign determine color."

    Thanks for help

    Angelika braun

    You're probably on a no-post script printer printing if InDesign does not give you this option.

    If you select the 'Document' radio and printer profile, select the document profile, InDesign does not perform color conversion.

    Normally, however, it is preferable to use the Adobe color management. This means, by printer profile, select the profile for the type of printer and paper. This should give a more accurate impression.

    If you're still having problems, you can try to export a PDF file, then print to Acrobat.

  • Problem with the color of background under Firefox

    On my web site, I put a color #FFFFEE to the bottom of the body.
    Then I have a div (box 2) that contains the text of the page; the background is white (#FFFFFF).
    On some screens, I display a list of records, the length of this list is variable.
    In IE, the background is always white; No problem.
    But under Firefox, when the list is short down takes the body background color (#FFFFEE).
    You can try it on my site web http://www.tregor.fr
    Try the menu built heritage / megaliths.
    In my mind the bottom of the list should be white as the color of the background of the parent is white.
    Does anyone have an idea on how to fix this?
    Thank you very much.

    Add background-color: #FFFFFF to .inside-2

  • Using JavaScript to determine the name of the file a form

    We have a lot of forms, and in many cases, our custom JavaScript if applies to all forms in a given folder. We want to determine the name of the file of the form so that we do not have to list each shape in a giant 'IF' statement.

    Has anyone found how to determine the folder of a form using JavaScript?

    Thank you!
    -Jake

    Hey Jake,

    Is good enough record id, it should not change anyway.

    Alert (externalFormId);

    will provide the folder under that accessed the form.

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • How to determine the color of a pixel on any given point on the screen?

    Does anyone know if it is possible to get the value of hexadecimal color of a pixel on the screen? And if yes how can I do this? I'm developing an application which can detect the color of an object in another (open) window and based on some steps. Any help with this would be greatly appreciated.

    Hey P-ylezc,

    You will need to use the call library function node to use GetPixel in LabVIEW.  Here is the document in the help file on the configuration of the node:

    http://zone.NI.com/reference/en-XX/help/371361F-01/lvexcodeconcepts/configuring_the_clf_node/

    In your case, copy the following code works:

    Note This is on 32-bit Windows, you may need to change this depending on what your system is.

  • Using Javascript to change the color of a button

    Hello

    I am changing a button from blue to red when selected.

    The button is named myShape.

    I tried:

    this.myShape.style.color = "FF0000";

    but no go.

    I also tried just setting the myShape as a clip instead of a button, but no go.

    The function of the button works as I have an alert is triggered when the button is clicked.

    Thank you

    Do you want to change the button color as long as it is which is clicked, or discoloration permanently after summer on it?

    If you just want to change while the click occurs, it's super easy with a button symbol: How to create buttons with Adobe animate (you would simply adjust the "low" State to be of whatever color you want.)

    If you want to permanently change, you could create a clip below an invisible button, and when the button is clicked you might it have to reach a specific image in the clip. in this image, you can use a shape tween to change the color of the shape of button, or you can simply use a keyframe to set the color of what you want it to be.

    Here is a small example of work of two of these options: https://www.dropbox.com/sh/jnrerw6suqfmpu6/AACC8_yuznQzf7h3esVU5VXya?dl=0

  • How determine the color of any image sent me

    Hi all

    I was sent a gif image to work on and the color of the image (RGB) allows to apply themes on the site.

    But I don't know the code RGB from the color used in the creation of the image. How can I find the color in Photoshop CS4?

    Thank you

    Use the eyedropper tool, it will set the foreground color that you can use.

  • How to change the color of the background behind the characters in Pages

    How do you change the color of the 'paper' where the characters are in Pages?  I tried all kinds of things and I'm sure, one time explained, will be simple.  But I don't know how to make the black characters and white background.  It was simple in Word.  Help, please.  Thanks in advance.

    I found the color of background here, under rules and the border:

    And the color of the text here:

  • Disconnect the color profile of Pro - 100

    For several years now, I've read about disabeling the printer color profiles to store photo profiles to determine the color printing. I thought I had done that, but it never seemed to make a difference in my impressions. Rarely they are in line with what was on the monitor, I have faithfully calobrated. However, a few minutes ago I stumbled on something. I arrived just to click on "Printing Options" and appear in a list little dandy from all sorts of neet to check things, two of them being: disable ICM required of the application software and the other: disable the color profile of the application setting. Do I have reason to assume that these two boxes should be checked? In the case where I make these decisions is more that I should have checked? Thank you...

    Got it, thanks John! I printed out the instructions and as soon as I finished the project I'm on now, I'm going to put everything and are let know how it happened... Thank you

  • How can I change the color of the Windows 7 Basic theme?

    After a year of the default theme for Win7 (which I liked), for a nice change, I passed to the Windows 7 basic theme. It is somewhat a return to the 95/98 default theme, and the taskbar are a clear/grey blue. Is there a way I can darken the color a little the taskbar, but keeping all the rest on this theme (form and UI icons, etc.)?

    In the section Customize, Windows had a link to the MS site for additional themes, but none of them had what I wanted.

    "Is there a specific option that determines the color of the taskbar?

    It's been so long I forgot what I did, but I found it.  You must use the option 3D objects.
    However, this also changes the bar tools, scrollbar, tabs and buttons (maybe more)
    so may not suit your needs because it will darken all of these features.

    This has led me to research for more information which has me thinking that I can finally
    play with AREO-

    THIS - link has some interesting comments about the AERO of Shawn B.

    I still need to read the following (on my next list) but it can be interesting to play with.

    howtogeek.com

    .

  • Different colors of background HTML for different slides

    Captivate 9

    Using the Skin editor I can change the background color of HTML for the ENTIRE project.

    However, how can I change the color of background HTML within the project?

    Example: I have a red background of HTML for the first slide and a blue for the second slide.

    Y at - it a trick to get there?

    (I don't know the background on each slide, I really want to change the HTML background outside the slides, but depend on the slide that is currently displayed on the screen).

    Thanks in advance!

    You can change like that. You can run this slide enter. Just make an index for each color. You can put hexadecimal codes in also.

    var myColors = [];

    myColors [0] = "#FFCC00";
    myColors [1] = 'Blue ';

    myColors [2] = 'green ';
    myColors [3] = "yellow";
    document.getElementById('cpDocument').style.backgroundColor = myColors [window.cpInfoCurrentSlide - 1];

  • How to make the color of the sky, exactly the same thing in multiple images?

    How to make the color of the sky, exactly the same thing in multiple images?

    Bengt Nyman wrote:

    I'm not trying to replace the sky. I want to talk to a group of photos BIF where the percentages of red, green and blue in the sky varies from a few percent, but enough to disrupt continuity within the group. I like t would be able to use the percentages of color to one of the pictures and replicated in others.

    Because the brightness of the sky probably varies from image to image using percentages RGB will not work. What you can use are the values of a and b the laboratory values . Right-click in the inside of the develop module histogram and tick 'Show Lab Color values.' You can ignore the value of L, which is the value of Luminance or brightness. Adjust the blue sky s a b valueusing the Temp WB and sliders dyed until they are the same as your first reference image file. The value determines the color red/green balance if you use the Tint slider to correct the value. The b value determines the color yellow/blue balance if you use the slider Temp to correct its value.

    Remember that setting the base Panel WB with 'fixed' values of b for photos taken under lighting conditions different sky will be the color of the other objects in the image look incorrect (birds, trees, buildings, etc.). In this case, you will need to use the brush setting to paint in the region of the sky and then use its temperature sliders and tinted to change just the color of the sky.

    To be honest I don't know why you feel it's necessary. Maybe you can post two screenshots: 1) with the sky that they way you want to and 2) an image that you want to resolve to match.

  • How to determine the window is larger than 1024px and sotp (2000)

    can I use the code on stage timeline (1000) as:

    If the windows width > 1024px { getStage().stop (2000) ;}}

    and timeline (2000) add code like:

    If width of windows < 1024px { getStage().stop (1000) ;}}

    pls help to make right.thanks. I am very new to this...


    Hi, Peter.

    You can use JavaScript to determine the width of the window.  Here's a simple explanation I found:

    http://www.JavaScripter.NET/FAQ/browserw.htm

    Hope that helps,

    -Elaine

Maybe you are looking for

  • Windows\SYSTEM32\AUTOEXEC. Not suitable for running MS-DOS or Microsoft Windows NT applications

    I'm trying to run a 16-bit MS-DOS program and I get get the above message. I am running XP service pk3

  • Windows could not search for new updates, error: 80070005, 80072F8F

    An erroe message appears when you try to download windows updates. I tried to use Microsoft difficulty It Center and it is said that repairs need to be made, it has been fixed, but the problem won't go away. Trying to submitt a request for assistance

  • Re-activate without a certification key.

    Like me, Dad uses his PC for everything although it is in a retirement home. However, it is not its Vista when it bought the PC, is then locked, PC wants key certification and Certification key is not found. We can re - turn on his PC, or is now the

  • multiple network

    Hello.. I am running windows 7... & using the NIC & respectable internal port... .becuse 1 internet for another 1 for lan... How can I use two networks at the same time? How to configure the settings? I have no ideas... pls help me?

  • New phone blackBerry, old OS Smartphones? Torch 9800

    I bought a new Torch 9800 about 2-3 months from an authorized dealer. Today I checked my iOS and noticed that it was 6.0.0.570. I also noticed that iOS 7 was released a few months before, I bought my phone. I was wondering if there is a way to update