Select all paths of a specific color in one document

Hi,
I'm on Illy CS2, windows xp.
I want to open a doc, run a script that selects all paths of a color, say 255,0,0 or 50,0,20,4 and changes that color to black or another color I specify and also changes the stroke. Is this possible? I can't see how i would do it?
Thanks in advance,
Stan

Unfortunatly there is no getByColor method - below is a clunky way to get an array of objects that match a provided CMYK color : <br /><br />// Color you want to match<br /><br />myColor = new CMYKColor();<br />myColor.black = 50;<br />myColor.cyan = 0;<br />myColor.magenta = 0;<br />myColor.yellow = 0;<br /><br />foundObjects = getSameColor("ALL",myColor);<br /><br />function CMYKMatch(control,test)<br />{<br />     if (test.black == control.black && test.cyan == control.cyan && test.magenta == control.magenta && test.yellow == control.yellow)<br />     {<br />          return true;<br />     } else { <br />          return false;<br />     }     <br />}<br /><br />function getSameColor(type,color)<br />{<br />     var results = new Array();<br />     if (type != "FILL" || type != "STROKE" || type != "ALL")<br />     {<br />               myArt = app.activeDocument.pageItems;<br />               for(var i = 0; i<myArt.length;i++)<br />               {<br />                         if (myArt[i].typename != "TextFrame") <br />                         {<br />                              if (type == 'FILL' || type == 'ALL') {<br />                                   if (CMYKMatch(color, myArt[i].fillColor)) { results.push(myArt[i]); }<br />                              }<br />                              if(type == 'STROKE' || type == 'ALL') {<br />                                   if (CMYKMatch(color,myArt[i].strokeColor)) { results.push(myArt[i]); }<br />                              }<br />                         }     <br />               }<br />     }<br />     return results;<br /><br />}

Similar Messages

  • (PS CS3) Selecting all text to change fill color?

    I have a graphic with text - the text was not inserted by Photoshop, and it's not selectable as text; it's just part of the graphic.  I'd like to change the color of the text.
    I can select each letter and individual block of punctuation, etc. by using the Magic Wand and Shift+Click on each item.  Is there a way, though, to simply select all of the text - or at least one complete line - with one or two moves or commands, vice the tediousness of clicking in each letter, comma, i dot, and so forth?
    Ed

    Given that the text is uniformly colored against a colorless background, a VERY easy shortcut can be to just use Image - Adjust - Hue/Saturation, pick a color, then change the Hue slider.
    Literally only a few seconds work...
    -Noel

  • AppleScript Needed...How to tell Pages to delete all texts with a specific color?

    How to tell Pages to remove all texts with the font size: 13 and color " disabledControlTextColor" from the developer palette?

    Sorry John,
    Now My question has changed,
    Now I want to fill the whole cell with a color , not only the text background
    Now I have the Solution. As from the previos post itself I got the Answer. I excuse all of u to put the related question in a new thread.
    Please leave it. I won't repeat it.
    <af:column sortProperty="Salary" headerText="#{bindings.EmployeesVO1.hints.Salary.label}"
    inlineStyle="#{row.Salary>'20000'?'background-color:Red;':'background-color:Orange;'}"
    id="c6">
    <af:outputText value="#{row.Salary}" id="ot4">
    <af:convertNumber groupingUsed="false"
    pattern="#{bindings.EmployeesVO1.hints.Salary.format}"/>
    </af:outputText>
    fixes my issue.
    Ranjith C
    Edited by: Ranjith C on Jun 30, 2011 4:46 AM

  • How Select All Text Objects with Specific Contents and Move to Top-Center?

    Mavens,
    In a ~230 page InDesign CC Book (9 INDD files), on about ~35 pages, there is a small text block with the word "NOTES."
    Currently, the NOTES text block is in the Middle-Center of the page. I would like to find a way for InDesign to move all ~35 instances of the NOTES text block to the Top-Center (of the page each text block is on).
    Is there an easy way to do this with Edit --> Find/Change?
    Thanks!

    Probably not.
    That text block really belongs on a master page applied to those 35 pages, and if it is, all you have to do is move it on the master page. If it isn't, you've got some work to do. Probably easiest to fix one, then coy it and use Paste in Place on the other pages, and delete the frame that's in the wrong place.

  • How do I copy and paste a gradient color from one document and then use the gradient on another document?

    I am making business cards. On the back of the cards there are two lines with gradients. Below is a card with a magenta gradient. I want to select both lines and change the magenta gradient to the orange gradient from the file below. How do I do this? (I do not want to copy a paste the orange lines and then move them over the magenta ones.) I just want to select the magenta lines and change their color to the orange gradient. This will insure absolute alignment. I want to do repeat the process with several other gradients too. Thank you.

    David,
    As I (mis)understand it, you may:
    1) Copy one orange gradient path to the magenta gradient path document;
    2) Select the two magenta gradient paths and change the Fill to None;
    3) Select the orange gradient path;
    4) Select the two magenta gradient paths and change the Fill to Gradient.
    That should give you the desired replacement. For multiple use of the same gradient, you may consider a gradient swatch.

  • How to select all emails from the same sender

    Hi
    I have been pulling my hair out with this one, what i want to do is select all emails from 1 specific sender and delete them, because my inbox is completely chocka, is this possible in mail.
    Cheers
    Karl

    There are multiple ways to achieve this. First, you could click the From header in the mailbox in question to sort by sender, then just click the first message from the desired sender and shift-click the last message. Second, you could do a search using the search bar, limiting it to the mailbox in question and searching only the From field using the buttons that appear when you start typing a query.

  • MIRO select all column items on PO Reference tab

    I have a user running 4.6C that wants to select all items in a specific column at the same time rather than having to select each one individually.  I have found the documentation to change the column sequence but I can not find anything regarding how to do this.  Is there a way to do this other than creating a customized user exit or ABAP code?  Thanks

    Please check these answered links:
    Re: Hide Fields in MIRO
    Miro
    MIRO
    Edited by: Afshad Irani on May 6, 2010 8:42 AM

  • How do you SELECT ALL on a page (used to CTRL L-CLICK in margin then mouse over selection)?

    In Pages 4x you could hold CTRL+LEFTMOUSE while in the margin area then select multiple things on that page you were looking by mousing over them (including selecting all).  Now you have to go one item at a time to delete? Is there a work-around?

    Ghazgkull wrote:
    . ctrl+clicking in iTunes selects all.
    No, it does not. You are still incorrect.
    ctrl + click does NOT select anything.
    It checks all boxes when you ctrl click on one box.
    If you want to select a bunch of consecutive songs...
    Select one then Shift click another, This will select all items from the first selection to the last selection.
    This is just plain nutty and is normally achieved on Windows 7 using ctrl+a,
    No it doesn't
    ctrl + a selects all.
    You are not selecting anything when you check all boxes. You are sinmply checking all boxes.

  • How to put a select all option in a dropdown list

    i have a dropdown list
    i have to select all options from the list by putting one check box,i mean by clicking that checkbox i have to select all options.
    If any body knows give answer its urgent

    raki1221 wrote:
    i have a dropdown list
    i have to select all options from the list by putting one check box,i mean by clicking that checkbox i have to select all options.
    If any body knows give answer its urgentThis is not UI forum...post it in Swing or AWT forum..
    One thing...which API are you using for UI... AWT or Swing ?

  • Linking to a SPECIFIC place in a document

    Hello,
    I am wanting to link from specific text in one document to a specific location in another document.  I have created Named Anchors in the document that I want to specific text to link to.  The code is listed below:
         <span class="style2">CHS 314</a><a name="CHS314" id="CHS314"></a> - Introduction to Native American Studies - Spring 2006:</a></span>
    I have used the Point to File method with both documents open (tiled vertically) to point from the text (in the document mission statement.html)  to the Named Anchor (in the document Research Papers.html).  Here is the code:
         <a href="Research Papers.html#CHS314">critical discussion of works of literature </a>
    The problem is that when I test this code in FireFox and IE, it opens to the PAGE (Research Papers.html)  but NOT to the SPECIFIC LOCATION (the  named anchor) #CHS314 on the page.
    I am wanting to and need to use the text on one page to point to specific courses on another page.  It doesn't really do me any good to open the page, without going to a specific location on the page.
    Am I missing something in the instructions on how to accomplish this task????
    You sage wisdom and expertise greatly appreciated.

    I don't think you're getting the picture. They are talking about having enough content on a page that will cause a browser with a viewport shorter than the content to scroll. When your content is too short to scroll, it is not difficult to find the place in the page you linked to - particularly with your naming scheme. We are talking about browser scrolling functions, not CSS.
    A couple of screen shots to illustrate (click to enlarge, if you want to):
    In the above grab, the browser's viewport is taller than the content (excluding your top banners and menus). It did its best to scroll to CHS314, but hit the bottom of the page.
    The above grab shows that a shorter browser viewport was able to scroll your link to the top, because there was enough content to scroll there without hitting the bottom of the page.
    Does that help?
    Mark A. Boyd
    Keep-On-Learnin' :-)
    Message was edited by: Mark A. Boyd

  • Applescript to change color of path items with specific swatch from swatch group, multiple times

    I am attempting to take a path item that is on its own layer and change its color multiple times, saving it each time.
    I was able to do it with javascript however can't get it to work in applescript.
    Javascript:
    (Items are already selected that I intend to change.)
    var iL = app.activeDocument.pathItems.length;
    var colorSwatches = app.activeDocument.swatchGroups.getByName('newColors');
    var allColors = colorSwatches.getAllSwatches();
    var colorNames = Array();
    for (var i = 0; i < allColors.length; i++){
        colorNames.push(allColors[i].name);
    for (x = 0; x<colorNames.length; x++)
            var currentColor = allColors[x].name;
            for (i=0; i<iL; i++)
                var myItem = app.activeDocument.pathItems[i];
                if(myItem.selected)
                    myItem.fillColor = app.activeDocument.swatches.getByName(currentColor).color;
    (I then go on to save each one)
    When trying to cross over into applescript I have the following so far:
                   set iL to count every path item of document 1
                   set colorSwatches to swatchgroup "newColors" of current document
                   set allColors to get all swatches colorSwatches
                   set swatchCount to count every item in allColors
                   repeat with i from 1 to swatchCount
                        set currentSwatch to item i of allColors
                        repeat with x from 1 to iL
                            set myItem to path item i of document 1
                   here is where I have no idea what I am doing... I can't figure out how to test if an item is selected
                            if myItem's has selected artwork is equal to true then
                                set fill color of myItem to {swatch:currentSwatch}
                            end if
                        end repeat
                   end repeat
    Or better yet is there a way I can select every path item of a layer and change its color that way?
    Something like the following:
              set fill color of every path item of layer "art" of document 1 to {swatch:currentSwatch}
    Thanks for any input!

    I'm throwing it into a Applescript OBJc project I am working with. I currently have it in a javascript file within the actual project however this is the slowest part of my project and I'm going to attempt to speed it up some.
    Let's say I'm changing the color of a path item 35 times... this starts to eat a ton of time up.
    My applescript save illustrator file as jpeg is much faster than the javascript one for some reason...
    It's also something I have needed to do numerous times in the past and never got around to asking.

  • Script that selects specific color coded layer?

    Hi Guys, does anybody knows how to find a layer in the layers palette using its color coding ?
    I've did this action for Photoshop for stacking layers on top of each other,basically it aligns one
    layer to another regardless of their position and size.Here is a demo how it works:  http://vimeo.com/13713886
    The action searches for the target layer via its specific name, using a simple .jsx script.This way the layer order in your document doesn't matter.However I don't want the action to rely on layer name either and was thinking that It can find the layer via its color coding
    I would be really glad if someone can write a script that searches trough all the layers in the layers palette and selects the color coded one.
    Thank you.

    This should do it...
    selectAllLayers();
    var selectedLayers =  getSelectedLayersIdx();
    for(var a=0;a< selectedLayers.length;a++){
        makeActiveByIndex( selectedLayers[a], false );
        if(colourMarkedLayer()) break;
    function selectAllLayers() {
    activeDocument.activeLayer = activeDocument.layers[activeDocument.layers.length-1];
    if(activeDocument.activeLayer.isBackgroundLayer)
    activeDocument.activeLayer = activeDocument.layers[activeDocument.layers.length-2];
    var BL = activeDocument.activeLayer.name;
    activeDocument.activeLayer = activeDocument.layers[0];
        var desc5 = new ActionDescriptor();
            var ref3 = new ActionReference();
            ref3.putName( charIDToTypeID('Lyr '), BL);
        desc5.putReference( charIDToTypeID('null'), ref3 );
        desc5.putEnumerated( stringIDToTypeID('selectionModifier'), stringIDToTypeID('selectionModifierType'), stringIDToTypeID('addToSelectionContinuous') );
        desc5.putBoolean( charIDToTypeID('MkVs'), false );
        executeAction( charIDToTypeID('slct'), desc5, DialogModes.NO );
    function getSelectedLayersIdx(){
          var selectedLayers = new Array;
          var ref = new ActionReference();
          ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
          var desc = executeActionGet(ref);
          if( desc.hasKey( stringIDToTypeID( 'targetLayers' ) ) ){
             desc = desc.getList( stringIDToTypeID( 'targetLayers' ));
              var c = desc.count
              var selectedLayers = new Array();
              for(var i=0;i<c;i++){
                try{
                   activeDocument.backgroundLayer;
                   selectedLayers.push(  desc.getReference( i ).getIndex() );
                }catch(e){
                   selectedLayers.push(  desc.getReference( i ).getIndex()+1 );
           }else{
             var ref = new ActionReference();
             ref.putProperty( charIDToTypeID("Prpr") , charIDToTypeID( "ItmI" ));
             ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
             try{
                activeDocument.backgroundLayer;
                selectedLayers.push( executeActionGet(ref).getInteger(charIDToTypeID( "ItmI" ))-1);
             }catch(e){
                selectedLayers.push( executeActionGet(ref).getInteger(charIDToTypeID( "ItmI" )));
          return selectedLayers;
    function makeActiveByIndex( idx, visible ){
        var desc = new ActionDescriptor();
          var ref = new ActionReference();
          ref.putIndex(charIDToTypeID( "Lyr " ), idx)
          desc.putReference( charIDToTypeID( "null" ), ref );
          desc.putBoolean( charIDToTypeID( "MkVs" ), visible );
       executeAction( charIDToTypeID( "slct" ), desc, DialogModes.NO );
    function colourMarkedLayer(){
       var ref = new ActionReference();
       ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
       var appDesc = executeActionGet(ref);
       if(appDesc.getEnumerationValue(stringIDToTypeID('color')) != 1315925605) return true;
       return false;

  • Making all paths into a group without selection

    I'm working on a script that will take every pathItem in a document and put it into a group (all pathItems in the document are groupless upon opening it, so there won't be other groups already in the document).
    I have a script that creates a group, then puts the highest placed pathItem into the group. I just can't figure out how to have to grab all pathitems in the document, or loop this one action until everything is in a single group. Also the kicker is, as the title suggests this script has to work without selecting anything by hand first (in other words having to click something to select it). Now if there's was a way to select everything with a script that would be awesome.
    Here's what I have so far:
    #target Illustrator
    //based on script from Carlos Canto
    var doc = app.activeDocument
    if ( app.documents.length > 0 ) {
    doc = app.activeDocument;
    newGroupItem = doc.activeLayer.groupItems.add();
    var gi = doc.groupItems[0]; // the topmost existing group
    var all = doc.pathItems[0]; // all paths in document
    all.move (gi, ElementPlacement.PLACEATBEGINNING); // move selected path inside the group
    all.evenodd = true; // necessary to determine "insideness" or to make holes.
    I also have this that I found here on the forum
    #target Illustrator
    // GroupFromSel.jsx
    // regards pixxxelschubser
    if ( app.documents.length > 0 && app.activeDocument.selection.length > 0) {
        var aDoc = app.activeDocument;
        var Sel = aDoc.selection;
        var GroupFromSel = aDoc.groupItems.add();
        for ( i = Sel.length-1; i >= 0; i--) {
            Sel[i].moveToBeginning( GroupFromSel )
    But saddly it requires selecting so two scripts, two possible solutions. I'm just working on both until I can get one to work.
    Any ideas?

    var all = doc.pathItems[0]; // all paths in document
    that's only the top most pathItem, change that to
    var all = doc.pathItems; // all paths in document
    ...and loop thru "all" and move each inside your group
    #target Illustrator
    //based on script from Carlos Canto
    if ( app.documents.length > 0 ) {
        doc = app.activeDocument;
        var gi = doc.activeLayer.groupItems.add();
        var all = doc.pathItems; // all paths in document
        for (i=0; i<all.length; i++) {
            eachPath = all[i];
            eachPath.move (gi, ElementPlacement.PLACEATBEGINNING); // move all pathItems inside the group
    else
        alert('no documents to process');
    for this set up we will run into trouble if you have other groups with pathItems

  • CS4 Select all compound paths?

    Hi all,
    There was a fab plug in set by Rick Johnson/Graffix called Select Menu. It is not yet updated for CS4.
    The only function from the set I truly need is the ability to select all compound paths. Just wondering if it is possible to do this with a script? I recently found a javascript to close all open paths, so that got me thinking there may be a way to select the compound paths with a script as well...
    The nice thing about scripts is they still seem to work even after a program upgrade. All my little applescripts are still working fine but my plugins are DOA in CS4. So I am thinking it would be great to have functions I depend on every day in script form.
    I also wondered if there is a way to call the script with a speakable items command, which I guess would mean creating an action to run the script that I could then assign to a function key...?
    So far I have not found a way to call a script in Illustrator using a speakable item.
    I have near zero scripting experience so apologies if this is an annoying stupid newbie question. I have RSI issues and need to do most of my work via voice commands... it can be challenging to figure out how to do these things since my expertise is in graphics, not programming.
    Thanks for any swift kicks in the right direction!!

    Hi,Thanks!!
    This does work but on a complex document it is very slow as it seems to be redrawing all the compound paths? It worked fine on a simple file but when I tried it on the kind of complex file I would actually use it on it has Illustrator hung up with a spinning beach ball....
    The Graphix plug in to select all compound paths worked instantaneously. Is there a different way to write this that would not be as processor intensive?
    Ah, the beachball just stopped spinning and all the correct paths are indeed selected...

  • When I have selected multiple paths using the pen tool, I can't make a selection out of them all, but only of the last one I created.

    I want to make a selection with both paths in the selection. But it's only allowing me to select one, if I try both the paths just dissapear.

    Similarly to what @JJMack said, if you use the direct selection tool (shortcut: A), you can either select all of the paths, or select a blank area of the canvas (which will deselect all paths) and then selecting the 'convert path to selection' button should convert them all simultaneously.
    This is one of several bothersome changes to the path selection functionality in CC.

Maybe you are looking for

  • Controlling Resolution of .pdf

    Hello, I'm building some charts that I need to offer as downloadble .pdfs and want to be able to control the size of the image that get's printed out after downloading. I'm doing a 'Save as .pdf' but when I open in Preview the chart is only about 320

  • FRM-92100 java.lang.NullPointerException with menu

    Hi, I have the following error when I attach a menu (mmb) to a form and then execute. But If I execute the form without the menu mmb, it works fine: FRM-92100: votre connexion au serveur a été interrompue. Causes possibles: erreur réseau ou panne du

  • How to view sys_context value in SQL Developer?

    hello i can view the results via sqlplus with following statements: SELECT SYS_CONTEXT ('empno_ctx', 'empno_attrib') empno_attrib FROM DUAL; SELECT * FROM SESSION_CONTEXT; both retrieve correct values; now, since i work mainly in SQL Developer i want

  • Nokia 360 Play MD-50W Speaker - No Sound Android P...

    Hi , Wondering if anyone can help a google search suggests others have experienced similar issues in 2012 but no solutions. I have a White speaker and a Samsung Galaxy SII running Android 4.1.2. Bluetooth works fine, syncs and plays music no problem.

  • IPad mini Wi-Fi + cellular 64GB Black

    My iPad mini doesn't recharge when I plug it into my computer, in the top right corner it sais "NOT CHARGING" can anyone help me with this?