Color chart added via JSX is not persistent

If (!) colorID in swatchlist))) {}

missingswatches [colorID] = colorNodeName;

return;

}

var targetLayerName = tpNodeID + '_' + tpNodeName,

app.activeDocument = this_doc,

this_cw = this_doc.groupItems.getByName (mycw),

myswatch = swatchlist [colorID],

myswatchname = swatchlist [colorID] .name,

swatchexists = false,

Newswatch;

try {}

var checkExistence = this_doc.swatches [myswatchname];

swatchexists = true;

Alert ('swatch' + myswatchname + "exist");

}

{} catch (err)

Alert ('swatch' + myswatchname + 'did not exist');

Newswatch = this_doc.swatches.add ();

Newswatch.Name = myswatchname;

Newswatch.Color = myswatch.color;

Newswatch.TypeName = myswatch.typename;

}

If (swatchexists = true) {}

var operateOnTrue = checkPathType (this_cw.pageItems.getByName (targetLayerName));

this_doc.swatches [myswatchname] .color = operateOnTrue.fillColor;

} else {}

var operateOnFalse = checkPathType (this_cw.pageItems.getByName (targetLayerName));

operateOnFalse.fillColor = newswatch.color;

}
This is a function I wrote to review some documents and draw from their shades. We have a naming system for our color charts and it matches the ID to choose one to add.
My problem is that it adds the perfectly fine nuances (both the element and the Swatch Library for the current document with the name, id, and the correct information), but then when you add a new shade, it completely ERASES the nuances in the library of the current document, while keeping color on layers.

Is there something I am doing wrong? It looks like a bug in artificial intelligence more than anything else - why add a completely shade would eliminate my Swatch Library?

Thank you.

I don't know if this applies to you, but I have had what seems like a similar problem earlier on a project that copies the nuances between the documents in question.

The gist of the problem is that when you copy a shade from one document to the other the swatch.color object stores the parent document as a property according to the type of color (IE SpotColor). When you put this swatch.color in a new document or different this property retains its value of document parent and seem to cause issues such as the nuances that disappears or swatches get renamed to "deleted the overall color" because I guess that the parent of shades is linked to another document.

So, where I orginally had something like the following for all colors:

var swatchInfo = oldDocRef.swatches.getByName('MyColor');
var newSwatch = newDocRef.swatches.add();
newSwatch.color = swatchInfo.color;
newSwatch.name = swatchInfo.name;

She had to be added differently depending on the type of color:

var swatchInfo = oldDocRef.swatches.getByName('MyColor');
switch(swatchInfo.color.typename) {
  case 'CMYKColor':
  var newSwatch = newDocRef.swatches.add();
  newSwatch.color = swatchInfo.color;
  newSwatch.name = swatchInfo.name;
  break;
  case 'SpotColor':
  var newSwatch = newDocRef.spots.add();
  newSwatch.color = swatchInfo.color.spot.color;
  newSwatch.colorType = swatchInfo.color.spot.colorType;
  newSwatch.name = swatchInfo.name;
  break;
}

So basically if it is a spot color, you need to dig into the subject of color, so you do not copy the parent property. Still not sure if this is your exact problem but maybe a value of a control.

Tags: Illustrator

Similar Questions

  • PANTONE + does not match the previous Pantone spot color chart. I have several customers who are using spot colors in logos etc and now these colors are a mess. Can I get and use the old color for Illustrator books?

    PANTONE + does not match the previous Pantone spot color chart. I have several customers who are using spot colors in logos etc and now these colors are a mess. Can I get and use the old color for Illustrator books?

    Well, the spot color has not changed, but the way they were simulated four-color changed, they now use color management to get to the nearest ink possible task.

    Here is some info:

    https://helpx.Adobe.com/Illustrator/KB/PANTONE-plus.html

  • the color chart "load" command does not in InDesign 2014 and 2015

    The "load the color chart" command in the Panel color chart does not in InDesign 2014 and 2015. Cannot click the Pantone or any other collection, they are all faded.  I have already trashed the Preferences folder and restarted ID and Mac. It started only once I have updated to the latest version of CC, but now it affects 2014 and 2015.  Don't know what to do, I don't like reinstalling one or the other.  Tried to go back to the CS6.  All solutions anyone?  Thank you!

    Screenshot 2015-07-20 13.14.21.png

    Color chart of load control is for loading samples from other documents or a swatch file.

    Use the new swatch command to add a color.

  • How to keep the chart with different colors when adding new data

    Hi, please help me.

    I want to compare my first plot the data (trace of legend) with my following data in the graph of the plot. my program didn't work it just add new field data and color for the next data has not changed.

    What's a matter of signal conditioning? Please, click on Options, and to request the removal of moderator for the jury of LabVIEW.

  • Ignore the models and processes of color chart by pushing to table

    How can I go on ignoring process colors and color chart of model when you press shades in a table? So far, I've been able to exclude the swatches by name, but ColorType.CMYK does not seem to do... Here is the excerpt in question...

    //Get Document Swatches 
    
    
    var swatchList = docRef.swatches;
    
    
    var colorList = [];
    
    
    
    
    for(var k=0; k< swatchList.length; k++) {
        if (swatchList[k].name.toLowerCase() != "thru-cut" && swatchList[k].name.toLowerCase() != "[registration]"// 
        && swatchList[k].name.toLowerCase() != "[none]" && swatchList[k].name.toLowerCase() != "cut line" //
        && swatchList[k] != ColorType.CMYK){
           
           colorList.push(swatchList[k].name);
               }
           }
    

    I'm passing on the syntax for ColorType offshore? While I'm there at - it a way to clean this list to make things more easy Add/Remove in the future. Ideally, I think I'd have a table that contains just the color chart to ignore... something like this:

    var ignoredSwatches = ["thru-cut", "[registration]"]
    
    for (var k=0; k<swatchList.length; k++) {
         if swatchList[k].name.toLowerCase() != ignoredSwatches {
              colorList.push(swatchList[k].name);
              }
         }
    

    Thanks in advance, people.

    Ok. I figured out the syntax to ignore certain types of color which is the following:

    &&  swatchList[k].color.typename != "CMYKColor"
    

    the syntax is the same for pattern or RGB colors as well. If this problem is solved.

    does anyone have an idea on how to create a list of color via a table instead of include the variable [index].name.toLowerCase () each time?

    the way I have it works fine, but I can't imagine that this is the right way.

  • InDesign CC 2014 doesn't load saved color chart

    I have some problems with my library of nuances in InDesign. I put a few groups of color with shades in them to load as default and it works very well when creating new documents, however they don't load in previously saved documents and appear not at all.

    I erased the preferences and that did not work ideas either, what it takes to try? I just stay persistent in my library of shades for all documents (the same as the default swatches make for the moment).

    By default the shades don't load already created documents.  If they did, if would be difficult to keep clean Swatch palette. all the colors I didn't need and had deleted would come every time I re-opened.

    You will need to use Load color chart, then choose a document containing the new color chart to import them.

  • Help! placed grayscale TIFF doesn't let me change his color chart of colors...

    Help! placed grayscale TIFF doesn't let me change his color chart of colors...

    Tried to revive demand, re-boot PC in the case of a technical problem. Something with graphic blocks that must be re-stored I don't know?

    I also tried to create a new page, import another image and persist on the issue.

    How do I "re-adjust" my settings so it does not once again?

    Thank you!

    Here is the information about resetting your Pref.: replace your preferences

    But this probably isn't the problem. Are you sure that the images are really grayscale? What format they are stored in? They may not be colorized to identity card if they are transparent or do not have a background layer.

  • Color chart rename using Java script

    Hi friends,

    I tried to rename the shades by using the following script,

    This does not work for the tinted shades. Can you please help me to solve this problem.

    myDocument var = app.activeDocument;
    for (i = 4; i < myDocument.swatches.length; i ++)
    {
    var mySwatchName = myDocument.swatches.item (i) .name;
    myDocument.swatches.item (i) .name = "XX_" + mySwatchName;
    }
    our var = myDocument.swatches.length - 4;
    Alert ("DONE and" amendments + "renowned color chart");

    Thanks in advance...

    Hello

    I copied the code and tried again, but it does not work because "Tone" was cut out by the SPACE such as 'T int' when I pasted here.

    I pasted the code again, but it will be added SPACE between 't' and 'int '. ??? Sorry, please delete SPACE and try again.

    {if (myDocument.Swatches.Item (i) .getElements () [0] .constructor.)} (Name==='Tint')}

    It works for me on OSX 10.6.4 + InDesign CS3, CS4.

    Shade of gradient swatches ==> renamed

    Tint Shade ==> based on color chart

    Thank you

  • Lost Bookmarks toolbar, added, but icons do not appear, or I can just add him...

    I had used the computer for a few hours when I noticed that my bookmarks toolbar was not be displayed. I added via the view menu. When I did a blank toolbar appeared, with none of my icons displayed. The icons are available in the Favorites, but do not appear in the toolbar. Also, I can not add all the icons on the toolbar by dragging them from the address bar.

    There are two "bookmarks" customize the icons in the bookmarks you don't want the one with the star, that you want has a blue off the coast of the central area, do not know what it is supposed to look like (perhaps a book with 3 unused bookmarks provided next to him).
    You will need to drag this icon of the empty Favorites bar.

    Bookmarks you should see in it are those of the 'personal bar' that you see in the bar Favorites (Ctrl + B).

    When you say that favorite talk Favorites in Internet Explorer, if you imported them in Firefox, you would have to move to your Bookmarks Toolbar folder after seeing "Bookmarks toolbar items" in the toolbar bookmarks to the course to customize.

  • How to load the driver scanner for HP color LaserJet 2840 via ethernet

    I am trying to load the scanner driver for HP color LaserJet 2840 via the network. When I got to the driver download page, I have two choices. We're driver HP color LaserJet 2820/2840 PCL6, the other is HP color LaserJet 2820/2840 PCL6 Plug and scan/print driver Solution play I don't know which I should choose. So I downloaded both.

    Then I followed the instructions on this page... http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?lang=en&cc=us&taskId=115&prodSeriesId=. I have correctly installed the driver HP color LaserJet 2820/2840 PCL6. But I do not know if the driver drives the scanner. And I could not print any test page either. I don't know if I installed this driver properly.

    But when I tried to follow the instructions to install the driver HP color LaserJet 2820/2840 PCL6 Plug and scan/print driver Solution play, I was confused when I tried to select the .inf file. There are a lot of .inf files in the directory. I had no idea which one I should choose. Also, I tried to run the EZInstall.exe, but it seems to only support direct connection via USB and not via the network.

    Could someone help me with this? Please let me know which version of the driver should choose, and how do I load this driver.

    Thank you!!

    One supports network connections, the other being a pilot plug-and-play (PnP) is configured to initialize and works with a USB connection.

    Let me know if makes you better in the right direction.

    Have a wonderful day!

    -Spencer

  • Record the color chart of model

    I created a shade of reason and (apparently) registered, but when I try to open it from another document, can't find it. If I search my hard drive I don't is not, even if I have (several times) saved in the folder of the color chart. Any tips? CS6/Mac

    You should be able to find them in def...

    But you can also load the browsing the other library > and select an Illustrator document that has the desired shade.

  • How to create a camera profile that works with a JPG image with my color chart to check inside? [was: color Checker chart.] Really need help]

    I got a color chart to check. It came not with any software whatsoever. I shoot my images in JPG format. I know it's not really ideal but I'm on a tight budget and don't have the money for a digital SLR cameras that shoot raw. Is there anyway that I can always create a camera profile that works with a JPG image with my color chart to check inside? My table also includes RGB values below each color. Maybe I can match each color in the photo these values manually? If so how is this done?

    Thank you

    Bryce

    I've never seen software that does what you ask for JPGs, only RAWs.  The main problem is that any profile or adjustment is calculated according a JPG of a particular chart photo would apply to the other JPG photos with the same white balance.

    Jpg does not use "camera profiles" anyway in Lightroom, the profile is always integrated.

    There is a product that allows to calculate the HSL cursor offset values given a JPG photo their own table owner who looked like a color checker, but had two lines reversed so the software could not be used with a standard-checker color, unfortunately.  Now their table has twice as many patches (48), and looking at it on their site I'm not too sure that it does not always work with JPGs or if she's just raw files, now.

    The graphic and software are called SpyderCheckr of Datacolor.  There are various software that do different things, but none are using a ColorChecker, so having one is mainly a loss until you get a camera that can take raw photos, so keep a humidity and temperature controlled environment as much as possible until you have the right camera.  You can probably use the grey patches to adjust exposure, but that's all.

    Today you need not a digital SLR to have raw photos, well.  My phone Galaxy S6 with the last update of Marshmallow and the software of camera update will take photos in format raw DNG in Pro mode which I can create custom profiles camera to use a ColorChecker, although the camera is really good in itself, so when I found everything first he could make DNG I took a little but now, I usually just use the camera to make the jpg unless the shot is really important and the lighting is not too hard.  I think that S7 phone's camera is even better.

    What kind of camera do you have?  Sometimes, there are firmware hacks that allow the camera to shoot raw format even if the standard camera cannot.

  • Suggestions to save commonly used color charts

    I could save a lot of time if I had an easy way to load and update a range of shade for Premiere Pro.  Because the color picker does not include an option for the recently used colors, constantly, I type in the numeric values for customer color schemes and useful colors.  Am I missing something here?

    PP CC 2015.2

    Mac OS 10.11.4

    Don't know if there is a way to generate the nuances in the first (although I guess you could make a screenshot and download that), what I do is to load the color chart at the Ps library or have

    and then to use these samples as samples of color for the first color picker

    MtD

  • New library filter column does not persist

    Hello

    LR 5.

    I add a new column to my filter (type of file for example),

    but when I restart LR, this new column does not persist and that it is simply missing.

    Either I'm back with the default columns 4.

    What I am doing wrong?

    Thank you!

    Boolis.

    Hi x 700700.

    After you have added a column for library filters save it as a custom preset and name it what you want.

    Thus, if in the case whenever the filter gets changed default column, you can still select it from your custom preset list.

    Let us know if that helps.

    Kind regards

    ~ Mohit

  • Cannot drag and drop a pattern to the color chart

    I have a PC with Windows 10 so maybe that's part of the problem.

    I've been working with a very detailed model and using the function drag / move in the color chart with no problems.  Then all of a sudden it stopped working.  Any thoughts?  I can drag and drop other items in, but not this model more.  Any thoughts?

    Try and select the object complete, then object > model > done. This can generate a more descriptive error message. Will there be a clipping mask in your work?

Maybe you are looking for