Changing color from Swatch to Spot color

Hello,
I have almsot figured this out but have on hangup.  I am trying to replace a color with another color from a Pantone library. I am using Illustrator CS6.
I have this script which I found on here:
#target illustrator
var docRef = app.activeDocument;
with (docRef) {
var replaceColor = swatches.getByName('Pantone 152 C').color;
for (var i = 0; i < pathItems.length; i++) {
with (pathItems[i]) {
if (filled == true && fillColor instanceof SpotColor) {
if (fillColor.spot.name == '  HCS Orange') fillColor = replaceColor;
for (var j = 0; j < stories.length; j++) {
with (stories[j]) {
for (var k = 0; k < characters.length; k++) {
with (characters[k].characterAttributes) {
if (fillColor instanceof SpotColor) {
if (fillColor.spot.name == '  HCS Orange') fillColor = replaceColor;
if (strokeColor instanceof SpotColor) {
if (strokeColor.spot.name == '  HCS Orange') strokeColor = replaceColor;
Which works,  but only if the new PMS color is added to the swatch list.  It seems I cannot get the swatch in the list easily using a script(which I have no experience with) or using an action.  Nor can I change the name after var replacecolor as it seems to only look for the swatch panel and not the color group or color book panel
Any suggestions would be helpful, I am looking at having to change 30,000 files.
Thanks,
Matt

Sure,
#1
#target illustrator
var docRef = app.activeDocument;
with (docRef) {
var replaceColor = swatches.getByName('Pantone 152C').color;
for (var i = 0; i < pathItems.length; i++) {
with (pathItems[i]) {
if (filled == true && fillColor instanceof SpotColor) {
if (fillColor.spot.name == '  HCS Orange') fillColor = replaceColor;
for (var j = 0; j < stories.length; j++) {
with (stories[j]) {
for (var k = 0; k < characters.length; k++) {
with (characters[k].characterAttributes) {
if (fillColor instanceof SpotColor) {
if (fillColor.spot.name == '  HCS Orange') fillColor = replaceColor;
if (strokeColor instanceof SpotColor) {
if (strokeColor.spot.name == '  HCS Orange') strokeColor = replaceColor;
#2
#target illustrator
var docRef = app.activeDocument;
var swatches = docRef.swatches;
try {
     var replaceColor = swatches.getByName('Pantone 152C').color;
catch (err){
     var replaceColor = docRef.spots.add();
     replaceColorColor = new CMYKColor();
     replaceColorColor.cyan = 4.84;
     replaceColorColor.magenta = 66.58;
     replaceColorColor.yellow = 100;
     replaceColorColor.black = 0.21;
     replaceColor.name = 'Pantone 152C';
     replaceColor.color = replaceColorColor;
     replaceColor.colorType = ColorModel.SPOT;
     replaceColor.tint = 100;
Here is the actions set up:
The 2 actions are the scripts, the export is after saving the eps.

Similar Messages

  • How can I convert CMYK PDF file to Spot Color from a standard Spot Library?

    Hi,
    I have PDF file that is in CMYK colors. Can I use Adobe Pro X to convert the document to Spot Color from a established spot library like the PANTONE PC? Is there a plugin to do it?
    Amit.

    In method HMAC, you have towards the bottom
    catch(Exception e) {}please change this to
    catch(Exception e)
                e.printStackTrace();
            }Note that using the sun.* classes, including the sun.misc.BASE64Encoder class, requires elevated privileges (see http://forum.java.sun.com/thread.jspa?threadID=483223&messageID=2255882).
    It is not difficult to write your own encoder/decoder class, or borrow one from someone else. Just google on "java base64 encoder".

  • My Illustrator does not allow me to change colors using swatches panel. Help pleas.

    Few days ago I started having strange problems with my Illustrator CS5 application. I am using MacBook Pro with Intel Processor.  After major update on the Mac OS  few days ago  I noticed I can not change colors in my drawings using swatches panel. The function on my Illustrator CS5 stopped working.  When I select object and try to change its fill or stroke color using fill and stroke from the options bar above work space,  none of the swatches would work.  The are there how ever nothing hapends when I select them, the color remains the same.The same thing happens if I try to use the swatch panel, I select the object then I try to select new color from swatch but the fill or stroke does not change. I can only change color on my drawings using the color panel but that is not useful for me since I need to get precise colors using approved color swatches ether from pantone library or approved by client.
    The other strange thing is my selection tool does not deselect when I click outside on or of the artboard, the object remains selected until I reselect another object or use the keyboard short cut to deselect it.
    I have tried various options to resolve the issue from deleting and reseting preference to completely uninstalling and  reinstalling Illustrator CS5. I even installed back my old CS4 version because I had to complete a project  and the same issue is happens there as well. I also reset the application using Time Machine from few months ago when it was working correctly. What happens when I reset or reinstall the app, it works for  about 10 min correctly as it should and and then it reverts to the same problem. I am out of options and do not know what else I could  do to fix this. Right now I am working on my old Mac tower G5 and CS4 where everything works as it is suppose to, but I really need to get this fixed. Can any one help or has solution for my problem? Please.

    hey i m working on my illustrator and i m having many problems with my swatches
    for example i use the green phosphorique i don't get this color i get another green
    and many colors too it's like illustrator chooses for you the only green color
    so please i kind of need help i can show you pictures of that i print screen viewed them.. so anybody who can help... pleaaaaaaaaaase contact me because i m having a project now..
    my e mail is [email protected] i would be thankful
    i even tried to download the illustrator on my friend's computer also i m having this problem ....

  • Color picker from swatches choosing random color (Illustrator CC 2014)...

    When I select a color from swatches, and use the color picker (i.e. double click fill color) for shades and whatnot, it initially shows a random color... anyone else getting this? Every single time you open the color picker it never stays at the current fill color... ugh. Now, if I pick a color from a Kuler swatch, it shows properly.

    I figured out a quick workaround to this that at least lets you continue on. When you select the object the color of which you want to know, the color picker dialog window opens. You'll see the false swatch color on the top (in this case the green) and the true color on the bottom (in this case the orange). Double click the orange color field. This will make both orange, and display the true values.
    Note that, unless you change some value, when you repeat this, it will still display the green.

  • How to change color of selected label from list of labels?

    My Problem is that I have a list of labels. RowHeaderRenderer is a row header renderer for Jtable which is rendering list items and (labels).getListTableHeader() is a method to get the list. When we click on the label this code is executed:
    getListTableHeader().addMouseListener(new MouseAdapter()
    public void mouseReleased(MouseEvent e)
    if (e.getClickCount() >= 1)
    int index = getListTableHeader().locationToIndex(e.getPoint());
    try
    if (((ae_AlertEventInfo)theAlerts.values().toArray()[index]).ackRequiredFlag)
    AcknowledgeEvent ackEvent = new AcknowledgeEvent(
    this, (ae_AlertEventInfo)theAlerts.values().toArray()[index]);
    fireAcknowledgeEvent(ackEvent);
    ((HeaderListModel)listModel).setElementAt(ACK, index);
    catch(Exception ex) {;}
    Upon mouse click color of the label should be changed. For some period of time ie. Upto completion of fireAcknowledgeEvent(ackEvent);
    This statement is calling this method:
    public void handleAcknowledgeEvent(final AcknowledgeEvent event)
    boolean ackOk = false;
    int seqId = ((ae_AlertEventInfo)event.getAlertInfo()).sequenceId;
    if (((ae_AlertEventInfo)event.getAlertInfo()).ackRequiredFlag)
    try
    // perform call to inform server about acknowledgement.
    ackOk = serviceAdapter.acknowledge(seqId,
    theLogicalPosition, theUserName);
    catch(AdapterException aex)
    Log.error(getClass(), "handleAcknowledgeEvent()",
    "Error while calling serviceAdapter.acknowledge()", aex);
    ExceptionHandler.handleException(aex);
    else
    // Acknowledge not required...
    ackOk = true;
    //theQueue.buttonAcknowledge.setEnabled(false);
    final AlertEventQueue myQueue = theQueue;
    if (ackOk)
    Object popupObj = null;
    synchronized (mutex)
    if( hasBeenDismissed ) { return; }
    // mark alert event as acknowledged (simply reset ack req flag)
    ae_AlertEventInfo info;
    Iterator i = theAlerts.values().iterator();
    while (i.hasNext())
    info = (ae_AlertEventInfo) i.next();
    if (info.sequenceId == seqId)
    // even if ack wasn't required, doesn't hurt to set it
    // to false again. But it is important to prevent the
    // audible from playing again.
    info.ackRequiredFlag = false;
    info.alreadyPlayed = true;
    // internally uses the vector index so
    // process the queue acknowledge update within
    // the synchronize block.
    final ae_AlertEventInfo myAlertEventInfo = event.getAlertInfo();
    SwingUtilities.invokeLater(new Runnable()
    public void run()
    myQueue.acknowledge(myAlertEventInfo);
    myQueue.updateAcknowledgeButtonState();
    // here we should stop playing sound
    // if it is playing for this alert.
    int seqId1;
    if (theTonePlayer != null)
    seqId1 = theTonePlayer.getSequenceId();
    if (seqId1 == seqId)
    if (! theTonePlayer.isStopped())
    theTonePlayer.stopPlaying();
    theTonePlayer = null;
    // get reference to popup to be dismissed...
    // The dismiss must take place outside of
    // the mutex... otherwise threads potentially
    // hang (user hits "ok" and is waiting for the
    // mutex which is currently held by processing
    // for a "move to summary" transition message.
    // if the "dismiss" call in the transition
    // message were done within the mutex, it might
    // hang on the dispose method because the popup
    // is waiting for the mutex...
    // So call popup.dismiss() outside the mutex
    // in all cases.
    if(event.getSource() instanceof AlertEventPopup)
    popupObj = (AlertEventPopup)event.getSource();
    else
    popupObj = thePopups.get(event.getAlertInfo());
    thePopups.remove(event.getAlertInfo());
    SwingUtilities.invokeLater(new Runnable()
    public void run()
    // search vector elements to determine icon color in main frame
    String color = getColor();
    fireUpdateEvent(new UpdateEvent(this, blinking, color));
    // Call dismiss outside of the mutex.
    if (popupObj !=null)
    if(popupObj instanceof AlertEventPopup)
    ((AlertEventPopup)popupObj).setModal(false);
    ((AlertEventPopup)popupObj).setVisible(false); // xyzzy
    ((AlertEventPopup)popupObj).dismiss();
    else
    // update feedback... ack failed
    SwingUtilities.invokeLater(new Runnable()
    public void run()
    myQueue.setInformationMessage("Acknowledge failed to reach server... try again");
    return;
    Code for RowHeaderRenderer is:
    class RowHeaderRenderer extends JLabel implements ListCellRenderer
    JTable theTable = null;
    ImageIcon image = null;
    RowHeaderRenderer(JTable table)
    image = new ImageIcon(AlertEventQueue.class.getResource("images" + "/" + "alert.gif"));
    theTable = table;
    JTableHeader header = table.getTableHeader();
    setOpaque(true);
    setHorizontalAlignment(LEFT);
    setForeground(header.getForeground());
    setBackground(header.getBackground());
    setFont(header.getFont());
    public Component getListCellRendererComponent( JList list, Object value,
    int index, boolean isSelected, boolean cellHasFocus)
    int level = 0;
    try
    level = Integer.parseInt(value.toString());
    catch(Exception e)
    level = 0;
    if (((ae_AlertEventInfo)theAlerts.values().toArray()[index]).ackRequiredFlag)
    setBorder(UIManager.getBorder("TableHeader.cellBorder"));
    this.setHorizontalAlignment(JLabel.CENTER);
    this.setVerticalAlignment(JLabel.CENTER);
    setIcon(image);
    else
    setBorder(BorderFactory.createLineBorder(Color.gray));
    setText("");
    setIcon(null);
    return this;
    I tried but when i am clicking a particular label, the color of all labels in the List is being changed. So can you please assist me in changing color of only the label that is selected and the color must disappear after completion of Upto completion of fireAcknowledgeEvent(ackEvent);

    im a bit confused with the post so hopefully this will help you, if not then let me know.
    I think the problem is that in your renderer your saying
    setBackground(header.getBackground());which is setting the backgound of the renderer rather than the selected item, please see an example below, I created a very simple program where it adds JLabels to a list and the renderer changes the colour of the selected item, please note the isSelected boolean.
    Object "value" is the currentObject its rendering, obviously you may need to test if its a JLabel before casting it but for this example I kept it simple.
    populating the list
    public void populateList(){
            DefaultListModel model = new DefaultListModel();
            for (int i=0;i<10;i++){
                JLabel newLabel = new JLabel(String.valueOf(i));
                newLabel.setOpaque(true);
                model.addElement(newLabel);           
            this.jListExample.setModel(model);
            this.jListExample.setCellRenderer(new RowHeaderRenderer());
        }the renderer
    class RowHeaderRenderer extends JLabel implements ListCellRenderer
        JTable theTable = null;
        public Component getListCellRendererComponent(JList list, Object value,
                                                      int index, boolean isSelected, boolean cellHasFocus){
            JLabel aLabel = (JLabel)value;
            if (isSelected){
                aLabel.setBackground(Color.RED);
            }else{
                aLabel.setBackground(Color.GRAY);
            return aLabel;       
    }

  • When I send or receive e-mail, the mail gets changed significantly from its' original form.....typestyle, size of letters, symbols, page layout, color, everything changes.....is there a way to fix that?.....

    When I send or receive e-mail (Thunderbird).....the mail gets changed significantly from its original form.....typestyle, font size, symbols, page layout, color.....everything changes.....is there a way to fix that so my the original form of the mail is not changed?.....

    Just to recap, this is a collection of ports I have collected over time for people who needed this information when setting up the HP ePrint app so that they could view their email from within the app.  I am certain other applications also need this information.  Although lengthy, I could not find a more comprehensive place to retrieve this information.  Feel free to post additional information, faulty information, or other related topics below as this is simply a collection of data and it would be practically impossible to test all of them. Thank you!
    Don't forgot to say thanks by giving "Kudos" if I helped solve your problem.
    When a solution is found please mark the post that solves your issue.
    Every problem has a solution!

  • How to change colors of LCD/VFD controls from SGC-Tek?

    Hi Anybody got idea how to change colors of LCD/VFD controls from SGC-Tek?
    I have tried but could not. When I try to make myself a nest cluster of clusters of LEDs, I can change colours but I can't do the same thing with LCD/VFD controls.
    Please check at LCD/VFD controls
    Clement

    I suspect this repsonse is somewhat mis-leading, the code has no effect on the control other than setting its state, although the route is somewhat tedious for the mod.
    I would imagine that the control is set up so that the pixels didn't move around when they are being used as controls.
    There are nested groups and locks on the controls, which might make the ordering in the cluster easier to manage.
    The following should work....... ;-) it did for me
    Open  your own new VI
    Open the main LCD VI
    Open the Browse VI Hierachy
    Drag and drop the LCD VI onto your own diagram
    Create a cluster from the LCD VI's connector
    Now ungroup the clusters and unlock them (this is tedious) if you create your own then you could be more imaginative in the structure, I leave that for homework.
    Then import a new bitmap (gif) into the control
    Now update the modified contol back into the master control
    ........ Told you it could be done, but I am not sure the pain was worth it.
    BUT
    Try the alternative control..... with colour settings as well, ANY colour and even some size control.
    It was here http://members.lycos.co.uk/sgctek/

  • Changing Color of MS Office 2013 - From Grey to White

    How do I make MS Office - Excel, Word and Outlook on normal white color just a MS 2007.. Please help.
    I tried changing it to white from account menu..but it still is the same. 

    So when you go to Accounts (or Office Account in Outlook) and change it from one of the two Gray options to White, nothing happens?
    Screenshots of the 3 color choices are here -
    http://www.slipstick.com/outlook/2013/changing-office-2013s-color-scheme/ - there aren't colors like in Office 2007.
    Diane Poremsky [MVP - Outlook]
    Outlook & Exchange Solutions Center
    Outlook Tips
    Subscribe to Exchange Messaging Outlook weekly newsletter

  • Ask your question.how do you change the color of your tex bubbles.i accidently changed it from green to blue and I dont know how i did it

    how do I change the color of my tex bubbles? I changed one from green to blue accidently, and I cant figure out HOW I did it!

    I have a new iPhone 4 which has the latest version uploaded.  My daughter just bought an iPhone 4s and when we text it's still green.  We want it to be blue for iChat.  What are we doing wrong?  Why don't we have blue bubbles?  Any help would be greatly appreciated. 
    Thank you
    ~Tammi

  • Start up screen changes color from blue/gray to brown

    My Macbook Pro recently started changing colors:  When 'start up' it begins with a blue/gray (normal) color but then changes to a light brown color.  The apple icon is still present though...
    Any ideas as to why the screen changes its color?

    You should try to erase the drive with Disk Utility, so any filesystem problem will be fixed, but if you haven't made a backup, you'll lose files.
    1. Go to Utilities > Disk Utility.
    2. Select Macintosh HD in the sidebar and go to Restore tab.
    3. Connect your external disk and drag it from the sidebar to Destination box, and press Restore.
    If it doesn't help, take the Mac to an Apple Store

  • How do I keep the visited hyperlinks from changing color?

    I am looking to keep the colors of visited sites, the same as unvisited chosen by the hosting site. For example; when I visit eBay, their hyperlink colors are different depending on location. They are black in the far left, and do not change color when visited. However, the hyperlinks in the center are blue, then change to purple after they are visited. I would like for the hosting site to use their own colors, but not differentiate from the unvisited links to the visited ones.
    I know I can change the color of the visited links to be the same as the non-visited links(FF>Options>Content>Colors>"change"Link Colors), but this is not what I am trying to achieve. When I do that, ALL links are my chosen color, even the links on the far left on the eBay page. Any help would be appreciated. Thank you

    Hi raven0, I'm not seeing this issue on Craigslist, although we're probably in different cities.
    Does this occur on other sites as well, such as search engine results? If so, it could indicate that Firefox isn't saving history for those page loads. You could check the Library dialog and see whether the individual pages are listed. Either:
    * Ctrl+Shift+h
    * History > Show All History
    If there's no history for those page loads, is it possible that the pages are being opened in private windows, or that history has become disabled in some other way?

  • How to change color of a button for specific time interval in jsp

    How to change color of a button for specific time interval in jsp.
    Please help.
    Thanks in advance.

    This was driving me crazy, too--and the previous answers did not seem to work. I eventually found that if I click one of the data symbols in the graph in exactly the right spot (see below), it selects only the data symbols and not the line. I can tell this because the little selection dots will be around each data symbol, but no selection dots will be on the line between the data symbols - like the graphic in Yvan's answer. Then and only then will the color symbol in the tool bar show the color of the data symbol, instead of the color of the line. I believe that you then have to first click on the color swatch in the toolbar and then select your color (or choose Show Colors and select from the color tool). Just clicking a color in the crayon box, for example, did not seem to work unless I first clicked on the color swatch in the toolbar, then clicked Show Colors on that dropdown, and +only then+ clicked the crayon or whatever.
    _The right spot to click_ seems to be just above the exact center of the data symbol, at least for the diamond shape symbol that I prefer. Sometimes it takes several tries to hit the right spot. If I miss it, the whole line is selected, which is indicated by the little selection dots on the line, between the data symbols. When I click the right spot, those selection dots go away, leaving only the data symbols selected. Then I can change the color, as described above.
    I hope this works for you too.

  • Changing colors brings up a new dialog I've never seen before...

    Hi,
    I think I broke my Photoshop CS4.
    For some reason, when I try to change colors anywhere (it could be the color of text, or the main foreground color) a dialog with swatches appears instead of the eyedropper tool I'm used to using in this scenario. I can't click on anything else in the screen except the options in this annoying swatches dialog.
    It looks like this :
    This is extremely annoying and frustrating, as this dialog won't tell me what the hexadecimal color values are (even when I click "Define Custom Colors").
    As of right now, the project I was working on is stalled until I figure out how to make this thing go away and let me use the eyedropper tool to change the color of something.
    This problem is new. I had my CS4 running since it came out and it never did this before.
    Thanks for any help you can provide!

    Edit>Preferences>General Change the color picker from Windows to Adobe.

  • Changing colors globally on multple layers

    I have a CMYK file a co-worker did (who's not here no more) with about 10 different layers and a couple of them have the same CMYK color - some layers are boxes and some are type.
    I have to change the cmyk value of one of the colors (that are on mulitple layers) to a different value.
    Is there an easy way i can select that one cmyk color (instead having to click on them individually) and change the color globally throughout.
    I know Indesign and Illustrator have merge swatches - does photoshop have that capability to change colors globally on different layers?
    I hope I've made sense of this.

    Marie:
    The short answer is no, you can't. You're much better off working on the individual layers according to their characteristics.
    One way you could globally change the color is use the select... color range function to get a selection of the color you need to change, then create a new adjustment layer... hue/saturation using the color range selection as a mask. Tweak the HSL values to match the new color you need. Any feathered values (say, 50% of the original color) might be ignored.
    Another (better) way would be to go to each layer and use the layer effects to add a color overlay effect with the new color. That's the way I'd go about it. It will work with screens. The great advantage to this method is that you can option-drag the color effect from layer to layer, so it is very quick to implement (assuming you know which layers to alter). Command-control click will help you identify which layer has the color you need to change.
    J

  • Why do I get a program error when changing colors?

    I get a 'Could not complete your request because of a program error' when I try to change colors on both the forground/background palette or from the color picker palette.  Is there a patch for this?
    I am using Photoshop CS6 version 13.0.1.x64

    Hi. Because this forum is for beginners trying to learn the basics of Photoshop, I'm moving your question to the Photoshop General Discussion forum.

Maybe you are looking for

  • AppleScript Error in Creating a New Contact (Help)

    I wrote this script w/ variable but I am getting an error on the make contact part of the script. What am I missing? --User Inputs to get Client details display dialog "Enter a Name, please: Please enter Contact's First Name:" default answer "First N

  • How to install CR 2008 Basic on web Server

    Hello, I'm a web developer using Visual Studio 2008 .NET. Need to install Crystal Report 2008 Basic on web server and can't. Is there any .msi on sap.com to download and install on my web server? Thank you

  • Currently restricted from purchasing services

    Hi.  I have a ticket that the agent will no longer respond to - SRX1268047143ID.  It was created on November 5th. As mentioned in the ticket, I have a message "You are currently restricted from purchasing services or redeeming vouchers. Please contac

  • Video Tutorial to help you understand how to make DVD menus

    Hi, I'm quite certain that most of the people on this forum already know what I'm going to share here, and if it has already been shared before, I'm sorry about that. There are, however,always people that are new to Premiere and encore, and don't hav

  • Can I pay back my money?? help me plz~

    hi.. this morning... i paid some money at itunes appstore. but i couldn't download apps... but my visa card was checked.. LOL... can i pay back?? and i saw unidentify checked list.. about 20$...