6 Replies Latest reply on Oct 27, 2015 10:21 AM by LeoMari

    find replace color [JS CS5]

    Mac_06 Level 2

      This could be a very novice question but after a lot of brainstorming, I couln't resolve it.

       

      I need to replace Registration color in anywhere in document with Balce color. I tried

       

       

      var doc = app.activeDocument;
      app.findObjectPreferences = app.changeObjectPreferences = null;
      app.findObjectPreferences.fillColor = "Registration"; //doc.colors.itemByName("Registration") /*This gives eoor: Invalid value for Set property 'fillColor. Expected Swatch, String,...'*/;
      app.changeObjectPreferences.fillColor ="Black"; //doc.colors.itemByName("Black");
      
      app.changeObject();
      
      app.findObjectPreferences = app.changeObjectPreferences = null;
      

       

      above code add Unnamed color in Find object field and Change object field.

       

      Is there anyone can help me to fix it.

       

      Mac