Script to change the selected layer to one of the drop-down list in the layers palette colors

Hello!

I was wondering if anyone knows of a script that would allow me to change the selected layers (single or multiple selection) in 'Light Blue' or all the colors in the menu drop-down? (see attached screenshot)

I found the following but it changes all layers and is the RGB color.

-----

say application "Adobe Illustrator"

set current_Layer in current document

view the dialog box "in the current document there is" & layersCounter & "layers." & "Recolor label layers?"

Repeat until (layersCounter = 0)

set color of layer layersCounter in the current document to {Light Blue}

set layersCounter to layersCounter - 1

end Repeat

end say

-----

Screen Shot 2015-06-12 at 10.46.46 AM.png

I don't know how the script so any help is greatly appreciated. Thank you in advance!

John

as far as I can tell this is only possible with a few other modifications... Since 'selected' is not a property of "layers" javascript cannot determine if you see a highlighted layer in the layers panel.

you could do one of 2 ways. Depending on how many layers you want to change the color, you can either make those visible or hidden (for example, if you want to change to 80% of the layers of a specific color, hide others 20%). and then simply add a clause inside the loop if for.

var doc = app.activeDocument;

var layers = doc.layers;

Blue of var = new RGBColor();

Blue.Red = 79;

Blue.Green = 128;

Blue.Blue = 255;

for (i = 0; i<>

If (layers [i] .visible == true) {}

var = aLay layers [i];

aLay.color = blue;

}

}

Tags: Illustrator

Similar Questions

  • Not by selecting for viewing, but don't drop-down list box option

    Is it possible to have an option in a drop-down list box that is the first thing that people see, but not a selection? The field is mandatory, but I don't want the first option to be shown. For example:

    < select a >

    option 1

    option 2

    option 3

    Thanks in advance

    Nope.

  • Part of the browser screen will flash intermittently and when trying to select a link out of my drop-down lists, click with the mouse selects the link above it.

    These problems occur only when you use Mozilla Firefox. I am using a Lenovo Thinkpad:
    1 site Web seem to flicker on the images, videos, maps, when the mouse moves around the screen.
    2 pointing the mouse over a link in the browser and a left click activating the link above (if it exists)

    Do not experience problems with google or ie. It started a few days ago.

    Thoughts?

    Hello paulo.eichelberger, try Disabling graphics hardware acceleration.

    You will have to perhaps restart Firefox for it to take effect, so save any work first (e.g. you compose mail, documents online that you are editing, etc.).

    Then perform the following steps:

    1. Open the Firefox Options window as follows:

      • Click the menu button

        then select Options.

    2. In the Options of Firefox window, click the Advanced tab, and then select general.
    3. You will find in the list of parameters, the checkbox use hardware acceleration when available . Clear this check box.
    4. Now restart Firefox and see if the problems persist.

    In addition, please check the updates for your graphics driver by following the steps in the following knowledge base articles:

    This solve your problems? Please report to us!

    Thank you.

  • The Back button only allows me to return a page at a time instead of select a previous page from a drop-down list. It is a real problem: someone has any ideas?

    In the previous version of Firefox, I could go back to a previous page by clicking on a part of the previous button which brought up a list of recently visited sites and clicking on one of them, might go back to this page. This installation does not seem to be available in the latest Firefox, and the back button only goes back one page at a time. It's really embarrassing, like,

      it now takes longer to get to an earlier page
      there is no visibility of previous pages visited
      any actions carried out on webpages are undone when going back through them - this does not happen when jumping back several pages in one go.
    

    It is a real problem, I used the old system constantly and cannot continue to use Firefox 4.0 unless there is a way around it.

    Use it to open the history list:

    • Right-click on the back or next button
    • Press and hold the left button of the mouse on the active back or forward button until the list opens

    You can watch this extension:

  • move selected value in one drop-down list to another

    Hello

    I have two lists, and I wanted to make sure that people choose in the first drop-down list before selecting from the second drop-down list. What I tried to do was so, if the user tries to choose something in the second and the first list was unsuccessful, an error message appears asking the user to select from the list.

    The problem I encountered: I can't change the value in the first list to the second list to check and see if the first list got whatever it is selected. Any idea?

    First list: Department

    second list: jobs

    in the first drop-down list

    var selected = xfa.event.newText;

    second drop-down list

    If (selected == "" |) some == "null") {}

    xfa.host.messageBox ("Please select from the first menu drop-down before choosing from this list.");

    }

    Thank you

    F.

    Hello

    In the first drop-down menu script, you declare a variable "selected". This form variable lives only in this event. You can not variable accessthat other events or other objects.

    You are on the right track, but rather to test the variable in the stated case, test the rawValue of the first dropdown.

    if (dropdown1.rawValue == null || dropdown1.rawValue == "")
    {
         xfa.host.messageBox(...);
         xfa.host.setFocus("xfa.form.form1.page2.dropdown1");
    }
    

    Hope that helps,

    Niall

  • How to make a pdf that can send a form to e-mail selected in a drop-down list box?

    I'm trying to be able to create a user of a pdf file I created, select an e-mail from a drop-down list box and then hit send and have it send to this email address that has been selected.

    Thanks for the help!

    Hello

    I don't think (maybe wrong) you can do this in InDesign. At the very least, you could draw the shape in InDesign, but I guess that the interactivity between the selection of the list and the action of mail should be done with Scripting Acrobat or LiveCycle Designer if you have.

    FWIW,

    Loïc

  • How to filter the XML related to drop-down list data source?

    Dear all,

    I quiet new to LiveCycle designer ARE for a few weeks I am working on it.

    Right now I have problem with filering XML Datasource with the drop-down list.

    I have XML files which includes data for the States and the city. I have one of my drop-down list associated with the State. My requirement is that I chose the 'State' the corresponding city names must appear in the second drop-down list.

    I searched the net and got two or three samples on it. But I failed to do my job of form as a requirement. Even if I generated the XML file structure given in the examples.

    Please check the attached xml file that I created.

    I have struckup right away. So, help me do this.

    Very much thanks in advance.

    Kind regards

    Sree Harshavardhana.

    Hello

    Your xml structure is virtually identical to one the week last with a similar question, http://forums.adobe.com/thread/518731.

    I've renamed the fields required in the attached example.

    It will be useful.

    Bruce

  • Script to change the selection of combo based on numerical values box is entered in a text box

    I implemented a form of feedback to student and I'm looking for how to refine the process for the user. Please see the image below. As you can see that the form has individual learning, each of which has three statements of "feedback". These are currently the combo boxes with predefined statements selected by the user in the menu dropdown. These statements are connected digitally to our marking scheme that is if the feedback statement uses the word "limited", it matches with a score of 20-39 on our scale of correction. If she uses the word 'excellent', he corresponded with a score of 70-100.

    Limited 20 - 39

    40 - 49 adequate

    good 50-59

    very good 60-69

    excellent 70-100

    Currently, the user enters the brand in the small text box size in the right corner of the relevant learning outcomes. The user must then manually select the corresponding instructions of feedback from the drop-down list box. Which is quite tedious. Here's the thing:

    Most of the time statements all match the digital brand, i.e. If the student received a score of 55, then feedback statements would usually all be in the 'good' category: '.. '. good quality research... «, ».. good analysis... «, ».. good research management... ". It would be a great time saver if the statements could be scripted to react to the numbers in the text box. For example, when the user types in a notes 50-59 feedback instructions themselves define automatically to all be '... good... ". There's still a thing.

    It is important that the user has the possibility to change the declarations of individual feedback if necessary. that is a mark of 58 may require two statements of feedback in the "good" and the other in the 'very good' category: '.. '. good quality research... «, ».. good analysis...', '... VERY good orientation of the research... ". The user must therefore always the option to bypass the automatic selection if necessary.

    It's beyond my Basic scripting capabilities, but I wonder if anyone can break this problem? Your help would be much appreciated.

    feedback-form-screenshot.jpg

    Thank you

    Charlie

    Hello

    I create a simple sample here - https://acrobat.com/#d=FFhf7MQtKrH5iickDJBBxw

    I used the blur of the text field event so that the code is triggered when you tab to or click elsewhere in the form, the code can easily be moved.

    I named the fields

    Text1

    Dropdown1

    Dropdown2

    Dropdown3

    and these will have to be renamed according to the names of your fields.

    Hope this helps

    Malcolm

  • Script to change the name of the layer to fill model name Please HELP

    I have a guy here for emergency! I have more than 2000 model files in a library. These models are all labeled with the same names I want my layers to have. I'll make a new layer for each design for a total of 2000 layers. layers of 2000 is way more layers, then I want to name by hand, so if I can run a script to give the layers the same name as the model they are packed with it would help enormously.

    Help, please!

    Thank you

    I agree with Christoph, it would be easier to create all layers in IE:-

    #target photoshop
    main();
    function main(){
    var file = File.openDialog("Please select Pat file");
    if(file == null) return;
    if(!documents.length){
       var doc = app.documents.add(UnitValue(300, "px"), UnitValue(300, "px"),72,"Patterns");
    }
      file.open("r");
      file.encoding = 'BINARY';
      var str = file.read();
      file.close();
      var patterns=[];
      //Thanks to X for the regex
      var re = /(\x00\w|\x00\d)(\x00\-|\x00\w|\x00\s|\x00\d)+\x00\x00\$[-a-z\d]+/g;
      var parts = str.match(re);
      for (var i = 0; i < parts.length; i++) {
        var p = parts[i];
        var sp = p.replace(/\x00/g, '').split('$');
         patterns.push([[sp[0]], [sp[1]]]);
          }
      //load pattern file
      app.load(file);
    for(var a in patterns){
    fillPattern(patterns[a][0].toString(),patterns[a][1].toString(),100);
        }
    };
    function fillPattern(name, id, opacity) {
        activeDocument.artLayers.add();
        activeDocument.activeLayer.name = name;
        var desc6 = new ActionDescriptor();
        desc6.putEnumerated( charIDToTypeID('Usng'), charIDToTypeID('FlCn'), charIDToTypeID('Ptrn') );
            var desc7 = new ActionDescriptor();
            desc7.putString( charIDToTypeID('Nm  '), name );
            desc7.putString( charIDToTypeID('Idnt'), id);
        desc6.putObject( charIDToTypeID('Ptrn'), charIDToTypeID('Ptrn'), desc7 );
        desc6.putUnitDouble( charIDToTypeID('Opct'), charIDToTypeID('#Prc'), opacity );
        desc6.putEnumerated( charIDToTypeID('Md  '), charIDToTypeID('BlnM'), charIDToTypeID('Nrml') );
        try{
        executeAction( charIDToTypeID('Fl  '), desc6, DialogModes.NO );
        activeDocument.activeLayer.visible=false;
        }catch(e){app.activeDocument.activeLayer.remove();}
    };
    
  • script to change the data type of column

    Hi gurus of the oracle.

    I have 190 tables in my database.

    I have the column type CHAR of all these tables data.

    I need to change the data type of CHAR in VARCHAR2 for all these tables...

    There the script to change the data type of all tables at once?

    Please help me in this regard.

    Thanks in advance

    Concerning

    REDA

    Hello

    There is nothing built-in to Oracle SQL to do.  Maybe your front-end has certain characteristics.

    You can write dynamic SQL statements to do.  In other words, you can write a query that the output is a SQL script like this:

    ALTER TABLE TABLE_A CHANGE (A_TXT1 VARCHAR2 (5))

    A_TXT2 VARCHAR2 (10));

    ALTER TABLE TABLE_B CHANGE (B_TXT1 VARCHAR2 (5));

    with one row for each column of type CHAR.  Notice how the first line of output for each table begins with ALTER TABLE... but the later lines at the same table.  Similarly, the last line of a table (which will be the same as the first row, if the table has only one column of type CHAR) to end with a semicolon, but other lines are not.

    Here's a way to generate and execute such a dynamic script in SQL * more:

    -Disable the features that make the output easy to read, but hinder the execution
    SET FEEDBACK OFF
    SET LINESIZE 500
    SET PAGESIZE 0

    -Create fix_char.sql
    COIL c:\some_pathename\fix_char.sql

    SELECT THE CHECK BOX
    WHEN ROW_NUMBER () OVER (PARTITION BY table_name
    ORDER BY column_name
    )  = 1
    THEN 'ALTER TABLE ' | table-name
    || "CHANGE (").
    ELSE «»
    END
    ||        column_name
    ||        "VARCHAR2 (').
    ||        DATA_LENGTH
    ||        ')'
    ||        CASE
    WHEN ROW_NUMBER () OVER (PARTITION BY table_name
    ORDER BY column_name DESC
    )  = 1
    THEN '); "
    Output END AS
    Of user_tab_columns
    WHERE data_type = "CHAR".
    ORDER BY table_name
    column_name
    ;

    SPOOL OFF

    -Turn on the features that make the output easy to read, but hinder the execution
    SET FEEDBACK ON
    SET LINESIZE 80
    SET PAGESIZE 50

    -Fix_char.sql performance
    @c:\some_pathname\fix_char

    It's good to change all the CHARIOT of VARCHAR2 columns.  The CHAR data type is nothing trouble.

  • Change the image when the drop-down list value form is selected

    I really thought that it would be easier but I can't function.

    I have a consignment of Paypal with a drop-down list. The list to select the color. I want to change an image on the page to display the correct color when the color is selected in the drop-down list. So a black image occurs when black is selected, a red when red - etc...

    I would be very grateful if anyone can share some brief, the browser compatible code. Thank you for any assistance you can provide.

    Bill

    You are right that this is not as simple as you might think at first.  You asked for succinct, but there are several steps involved in mode Code (horror!)

    1) first add this script just before the closing tag () on your page head and then insert all your path/imagenames where see you mine.  Notice of the ORDER OF THE IMAGES must match the order of your choice to be called with the list of drop-down selection in your form! :

    2) in second place, in your form, add the below onchange event for thetag.  Note that in this example, the ID on the we will work with the tag is "theImg", change that, as needed.  If youdo not already own one identifying the tag (see further below), just use "theImg".

    So here's a form with a select field.  Use whatever values you need to do this, just add my onchange event as shown:


      <>name = "productColors" id = "productColors" onchange = "diva_imgBySel ('theImg', this.selectedIndex)"> "
       

    3) Finally, you can click on thetag, then click on the Tag/behavior window, click sound + plus sign and select "Preload Images" and adds all imagenames so they will appear more quickly when the selection list is used.

    Hope that all of the senses.

    -- 
    
    E. Michael Brandt
    
    www.divahtml.comwww.divahtml.com/products/scripts_dreamweaver_extensions.phpStandards-compliant scripts and Dreamweaver Extensions
    
    www.valleywebdesigns.com/vwd_Vdw.aspJustSo PictureWindowJustSo PhotoAlbum, et alia
    
    --
    
  • Script to change the key of win8 silently

    I need a script to change the key for win8 silently, there are hundreds of systems whose key is goinng expires soon, so I need a script that can the key Active silently without user interaction. Planning to deply the script using SCCM, any suggestions would be helpful. Thanks in advance...

    Since this isn't a scenario of domestic consumption current, you'll get best advice of experts of INFORMATICS:

    http://forums.technet.Microsoft.com

  • Mac OS 10.6.8 - Photoshop CS5.1 after years of perfect use, suddenly I'm unable to select a layer by clicking on the image and select it in the layers palette.  Solve this problem for me and I'll buy you a new car.  With our thanks, David Heidelberge

    Mac OS 10.6.8 - Photoshop CS5.1

    After years of perfect use, suddenly I can't select a layer by clicking on the image and select it in the layers palette.

    Solve this problem for me and I'll buy you a new car.

    With our thanks, David Heidelberger

    Hi David

    Have you checked your settings to automatic selection in the upper left of the workspace?

  • I have one drop-down list box where one selection (options) is the other.

    I have one drop-down list box where one selection (options) is the other. If a user selects the other, I want to conceive the possibility for them to enter some Notes to describe their other. A pop-up window or the text box is possible? Do not know how to approach the issue... Thank you!

    The field in parentheses is the text (or drop-down menu or other) you want to display when "Other" is selected and hide when it is not.

    If you want to apply the same logic to several fields just duplicate this line of code, the field name in each copy of setting.

  • Change the background color of a table cell, depending on the selection in a drop-down list

    I have a drop-down list wrapped in a subform in a table cell. Users can choose green, yellow or red, and I want the background color to change according to their choice.

    Can you tell me why this script does not work? I'm sure that some of you, dear friends can see in a second.


    If (this. ListItem == "green") {}

    Subform1.DropDownList1.fillColor = "000,128,000"; BackgroundFill = "solid";

    }

    If (this. ListItem == 'yellow') {}

    Subform1.DropDownList1.fillColor = "255,128,000";

    }

    If (this. ListItem == 'red') {}

    Subform1.DropDownList1.fillColor = "255,000,000;

    }


    Thank you

    Hello

    I think you should be able to use the following code in the event change of the dropdownlist control.

    Form1. #subform [0]. Table1.row2.DropDownList1::change - (JavaScript, client)

    If {(xfa.event.change=="green)"}

    this.fillColor = "000,128,000";

    }

    If {(xfa.event.change=="yellow)"}

    this.fillColor = "255,128,000";

    }

    If {(xfa.event.change=="red)"}

    this.fillColor = "255,000,000;

    }

    Concerning

    Bruce

Maybe you are looking for

  • How to create an equation average. If looking for a range of time?

    Let's get this out of the way: numbers 3.6.1 on a MacBook Pro of retina. I have run activities which start time randomly all day, at various periods of 15 minutes (10:00, 10:15, 10:30, etc.)  Every day have sessions starting at different times, accor

  • No service since update to 9.3.1

    Since upgrade to 9.3.1 on my iPad it shows no service but the wifi doesn't work.  I restarted twice.  Any suggestions?  Thank you!

  • My XP Pro c drive is failing and I need to make an image

    My Hp Compaq DX5100MT hard drive is failing, I want to make an image of it on a new drive. I am running XP Pro Version 2002 Service Pack 3

  • 2310 monitor m

    Hi, I recently bought a 450 t and 2310 monitor m.  Should I try to update the driver for the monitor with the disc that came with it?  Or is the elite of 450 t already come with the latest drivers for this monitor?

  • Z10 E-mail blackBerry installation

    Hello I am trying to set up my email on the Z10, and he repeats to me that my SMTp server is not responding. I can receive emails but I'm unable to send. What should I do? Thank you Jean Yves