Apply each swatch color library to the path on a page

Hello

I'm trying to write a script that applies to a single shade to a single path element and repeat for each swatch that is currently on the Swatch Library. This script I wrote only applies the latest nuance in the Swatch Library to each element of the path on the page. Currently, I am more concered with obtaining of each sample that is currently in the Swatch Library to apply at least once before you worry about the same fix was applied to any number of additional items of patch compared to the swatches.length.

// Apply every swatch library color to path items on a page
if ( app.documents.length > 0 && app.activeDocument.pathItems.length > 0 ) {
    doc = app.activeDocument;
    for (var i = 0; i < doc.pathItems.length; i++) {
    pathRef = doc.pathItems[i];
    pathRef.filled = true;
        for (var s = 0; s < doc.swatches.length; s++) {
        pathRef.fillColor = doc.swatches[s].color;
        }
    }
}

If you want to apply swatch1 to path1 to path2 swatch2 and so on?

If Yes...

// Apply every swatch library color to path items on a page
if ( app.documents.length > 0 && app.activeDocument.pathItems.length > 0 ) {
    doc = app.activeDocument;
    s = doc.swatches.length;
    j = 0;
    for (var i = 0; i < doc.pathItems.length; i++) {
        pathRef = doc.pathItems[i];
        pathRef.filled = true;

        pathRef.fillColor = doc.swatches[j].color;
        j++;
        if (j==s) {j=0}
    }
}

Tags: Illustrator

Similar Questions

  • Is it possible to use a color library for the selected text in a text box?

    What I would do, it is to be able to select a string of text in a text box and assign a color of the library. Currently, all you get is an audible 'bong' If you highlight the text and you try to select a color in the library. Similarly, if you select the text, then select the palette of color of the characters and then try to pick the color of the library, it will not do.

    Attempt of steps:

    1. Select the text you want to change the color in a text box

    Screen Shot 2015-01-24 at 2.11.30 PM.png

    2. Select the color in the character window

    Screen Shot 2015-01-24 at 2.12.14 PM.png

    3. try to select the color in the library

    Screen Shot 2015-01-24 at 2.12.26 PM.png

    I imagine that this has not been just haven't implemented but I want to just make sure that I wouldn't have missed something if there is a way to make it work in the way that it seems , it should.

    You can hold down the left mouse button, click anywhere in your picture, drag the eyedropper on the libraries Panel, hover over the different shades and you should see the colors change in the color picker.

    When you find the color you want, release the mouse button.

  • How can I apply a current color fill for a stroke, then adjust the construction of the color of this race?

    Hi all, I am trying to find a way to automate a simple process, but repetative I do countless times a day. Ideally, I would like to attach it to a combination of keys to speed up my work flow.

    I'm working on the drawings to the mark and color for the shoes, so the way I'm coloring these forms and lines helps separate the various materials and parts of the shoe.

    The coloring of the line drawings, I'm working with Pantone spot colors as fillings for closed path objects. I have then manually apply that same color for once, the value of the stroke weight 0.5px, convert this color CMYK spot and add 15% of the value of K.

    I found a code in a former post office to apply the fill color of the object selected in the race, but I'm going to but I can't the next step to find how to take this spot stroke color and convert it to a generation CMYK that I can then add black to 15%. -What is still possible? I spent an hour playing with the script and had luck for the fill color or by turning the white line. Thanks for the help!

    OK try this, I added the spot color option

    // make stroke color same as fill color + 15% black increase
    
    if ( app.documents.length > 0 && app.activeDocument.pathItems.length > 0) {
        for (var a=0; a100 ? 100 : black;
    
                    sel.strokeColor = col;
                    sel.strokeWidth = 0.5;
            }
            catch (e){alert(e)
            }
        }
    }
    
  • How to access another library to the user of the account root on mac 10.11

    Hello experts, can you help me please know how to access the library of the user of an account when I am logged in as user root 10.11?

    Open the users folder, and then his home folder, choose go to folder from the Finder menu and provide exactly the library as the path. If you wish, you can put the name of the follow-up folder a / at the beginning of the path instead of double-click this folder.

    (139251)

  • Access to the library of the user on the backup drive

    I need to access my preferences of old logic disk clone.  I know that if I worked this system I would just press option/GB and I could access the user library but I try to access to the outside, the last time I tried to restart from that clone drive it wouldn't work.

    Open the copy in your folder on this drive, choose go to folder from the Finder menu and provide exactly the library as the path.

    (139232)

  • How can I get rid of the path of the directory to my folder names in the list in the library of files mode?

    I'm using the latest version of Lightroom 5.3 (updated through CC - even if it is presented on the previous version) on Windows 7 and all the files in my library are showing up with the path of the directory in front of my name of folder. How can I get rid of this? I don't see any option in the preferences to disable this option. I also disabled preferences in Windows > Control Panel Options folder option "show the full path in the title bar.

    I have Lightroom on multiple computers and have set up preferences the same on each workstation, and it appears on a workstation.

    Any help would be appreciated.

    You can see in the picture below how this profile.

    Thank you

    Thank you!

    2014-02-16_190807.jpg

    Click on the small arrow down / + symbol following the sign + - in the folder bar.

  • Coloration of the paths of the same object differently?

    I hope I am on the right terminology here... Imagine a square drawn by the pen tool. A square with a line and filling. What I want to do is to 'none' color of two opposite sides (strokes) of the place while keeping the inside fill color. What is the best way (or indeed any way) to do this? It should be very simple, but has been driving me crazy here!

    Thank you

    CGG

    Duplicate the path, split the path to its anchor points, remove unwanted segments. then apply the stroke to parts and fill only to the original.

    Mylenium

  • Are the files swatch color management?

    Can I use Adobe Swatch Exchange to save a set of samples of my Swatches Panel and send them to someone else. Anyone know if this is color management? If I set up a shade which is C27 M60 Y100 K11 when working on a project that I intend to print using 2006 GRACol and then send it someone else who works on a project he wants to print using SWOPv2, the nuance will get changed to C29 M63 Y100 K17 (which is the recipe for this same color in SWOP)?

    If I understand the nuances Adobe Swatch Exchange must be color managed.

    Here is what it says in the InDesign help:

    "You can share the strong shades that you create in Photoshop, Illustrator and InDesign by saving a swatch for exchange library. The colors appear exactly the same across applications as long as your color settings are synchronized. »

  • Apply a different color to the gradients

    Probably be very stupid, but I have a question regarding the application of the gradients.

    I did a rectangular box to frame some images in my document and apply a fade to the box so that it looks better with the text on the left side.  However, whenever I have apply the gradient, color automatically goes to black.  When I try to ride this gradient of red instead of black, the whole box is new red (remove the gradient).  I can't work out how to apply a gradient to the color of my choice - as I say, probably be thick!

    Hope you can help.

    Thank you

    Mark

    Mark,

    (1) select the path with the grayscale gradient to be changed;

    (2) in the gradient palette, click on the black square under the cursor (the color of end); in the color palette, you will see a value of 100K;

    (3) or

    (a) click on the up arrow to the right page and select the space to the right color (RGB as the document) and insert the desired value (s of R, G, and B), or

    (b) AltClick/OptionClick a shade of the color of the right end.

  • Despite indicating to the path, still have manually pointing DLL every time LV works using the library function node call

    I use the node of the library function call in LV 8.6. I checked the path to specify the box diagram and made directly in the DLL file that I use. Whenever I have started with Labview, I have to go to the diagram and physically find the DLL in one of my calls to make it work properly. Once I have do this everything seems to work as expected. Anyone else see this issue? Any suggestion would be appreciated.

    Thank you

    Steckman wrote:

    I use the node of the library function call in LV 8.6. I checked the path to specify the box diagram and made directly in the DLL file that I use. Whenever I have started with Labview, I have to go to the diagram and physically find the DLL in one of my calls to make it work properly. Once I have do this everything seems to work as expected. Anyone else see this issue? Any suggestion would be appreciated.

    Thank you

    Probably that DLL does not depend on other DLLs that reside in the same directory you point to in the configuration node dialog box call library. What is happening is this:

    Without going into this directory:

    LabVIEW applications Windows to load the DLL, Windows detects that it needs to load other DLLs and can not find in its standard search sites:

    (1) already loaded into memory

    (2) in the application directory (where the exe that began the current process resides in the LabVIEW IDE would be where is LabVIEW.exe)

    (3) in the system directory

    (4) in the Windows directory

    (5) any directory in the PATH environment variable contains

    (6) in the directory 'active '.

    Because Windows cannot find a person to load DLL he abandoned the main DLL loading and returns an error to LabVIEW.

    Now, you go to the configuration dialog box and point to the DLL. The dialog box browse file in LabVIEW uses the standard OS dialog box and this dialog box has the behavior obnoxious always update the "current" directory in the directory where a file got selected in. LabVIEW sees now that the path has "changed" and asks again to load the DLL. Yet once, Windows detects that it needs to load other DLLs too for this DLL but this time going over the search order, it will actually hit the DLL in the same directory and that's all fine.

    It is certainly NOT a problem of LabVIEW. LabVIEW does not and should not really need to know that a DLL needs other DLL loaded and more importantly should never try to think he can do better than Windows, it probably could, but is simply not his task of dependency DLL loading.

    It is your responsibility as a programmer and user of this DLL to know its dependencie, and if you did not write the DLL, to hit the original on his head programmer, if it has not documented these dependencies and make sure that these dependencies are actually properly resolved for Windows placing them in one of the places mentioned above

    ((2) is generally the best location for applications applications because it will not pollute the Windows directory or the user of the application system and 5) is the best for the development machine as you can add a directory to your PATH environment variable where you put the dll you need to develop a specific application.

    Rolf Kalbermatter

  • After you have installed the latest Pantone color library in photoshop, some colors are inaccessible

    I try to refer to a specific Pantone color in Photoshop. I want to use the color library browser, so that I can easily get an overview of my chosen color variants. The color, I'm working with is not available in the original Pantone Coated color book provided with my version of Photoshop. So I downloaded and installed the Pantone color Manager and checked the color I want IS identified in the book lying in the Pantone color Manager. Great! I saved the book of color as a .acb file and installed in Photoshop. But I can not yet select some colors. They exist in Pantone color Manager, but they are not searchable from within Photoshop. Very strange!

    Here are the steps I followed to bring the book of the color in Photoshop:

    1. launch Pantone Color Manager

    2. Select the formula Guide - coated color book

    3. perform a search for "2128" and ensure that color exists.

    4. choose Save as... and save the file with a .acb (Adobe color book) file. I named it "PANTONE + Solid Coated - V3.acb.

    5. exit Photoshop

    6 copy the book of color in books color file in Photoshop (/ Applications / Adobe Photoshop CC 2015/Presets/color books).

    7. start Photoshop.

    8. open the color picker and click the button "color libraries".

    9. choose my new book of color in the menu ("PANTONE + Solid Coated-V3')

    10 type '2128': not found (Photoshop shows me 212c instead).

    I scrolled the book color in Photoshop - color isn't here!

    What I am doing wrong?

    You want to export the color book. Then it must meet 2-1-2-8 in the Photoshop color picker and I would choose Lab as the color model during export.

    Gene

  • What a fool has decided to ease the paths in PS CC with no way to change the color or contrast. Now I have to find a clear channel to perform the pat to contour photo... Adobe - fix!

    What a fool has decided to ease the paths in PS CC with no way to change the color or contrast. Now I have to find a clear channel to perform the pat to contour photo... Adobe - fix!

    Cc of Photoshop

    @

    One of the first things I do after installing Photoshop is to disable anti-aliasing for the paths for this reason. Paths are much easier to see, use and follow with this option off.

  • Hi, why my color is not the same between the library and the development.

    Hi, why my color is not the same between the library and the development. The color is yellow in the library... I'm not problem before windows 10...

    thx for your answer...

    The upgrade of Windows 10 has probably replaced you previous monitor with an incompatible profile mode. Calibrate your monitor or assign the previous monitor profile to your screen

    http://Windows.Microsoft.com/en-us/Windows7/change-color-management-settings

  • Don't care about the color of the color library

    How do you get the specs of the color from the color library? I expected there would be RGB, CMYK, and Hex color specifications and I am unable to find it.

    Thank you

    Don

    Hi Don,

    This link might help: Adobe color CC

    Kind regards

    Sheena

  • creating a box and is not be able to select a color in the Swatches palette to fill the box?

    I'm on a Mac of Yosemite, anyone performed by creating a new document, creating a box with a tool box and is not be able to select a color in the Swatches palette to fill the box?

    I have two screens, I had to move the Swatches palette on my main computer and was able to then select the shade. Before it was essentially trying to grab and drag the box color hand only to choose the color. Problem solved.  Thank you

Maybe you are looking for