How to hide/show layers according to color of layer?

Hello Photoshop geniuses,

I used Photoshop for a number of years, but I have ventured little in the script.

I need to come up with a script that toggles the visibility of the layer color (red/orange/yellow/green/blue/violet/grey)

I also need another script that cycles between layers and check the names (if the FG or BG) and in function of what names they have, say, if the layer is FG, then assign blue color channel, otherwise, if the layer is BG, then re-branded RED color

If you are wondering why I need it, I'm an artist that we need to create versions of the same texture and texture change of colors but use the same mask in a folder.

Thanks for the help, would be greatly appreciated.

I recommend you create a thread for a question.

show red layers, hide other layers;

2016, use it at your own risk.

#target photoshop

If (app.documents.length > 0) {}

the file;

myDocument var = app.activeDocument;

get the number of layers;

Var ref = new ActionReference();

ref.putEnumerated (charIDToTypeID ("Dcmn"), charIDToTypeID ("Ordn"), charIDToTypeID ("Trgt"));

var applicationDesc = executeActionGet (ref);

var number = applicationDesc.getInteger (stringIDToTypeID ("numberOfLayers"));

treat the layers;

var theLayers = new Array;

As var = new Array;

for (var m = 0; m<= thenumber;="" m++)="">

try {}

Var ref = new ActionReference();

ref.putIndex (charIDToTypeID ("Lyr"), m);

var layerDesc = executeActionGet (ref);

var layerSet is typeIDToStringID (layerDesc.getEnumerationValue (stringIDToTypeID ("layerSection")));.

isBackground var = layerDesc.getBoolean (stringIDToTypeID ('background'));

If the layer group not collect values;

If (layerSet! = "layerSectionEnd" & layerSet! = "layerSectionStart" & isBackground! = true) {}

theName var = layerDesc.getString (stringIDToTypeID ('name'));

theID var = layerDesc.getInteger (stringIDToTypeID ('layerID'));

visible var = layerDesc.getBoolean (stringIDToTypeID ("visible"));

var theColor = layerDesc.getEnumerationValue (stringIDToTypeID ("color"));

If (typeIDToStringID (theColor) == 'red') {theLayers.push ([theName, theID])}

else {theOthers.push ([theName, theID])}

};

}

catch (e) {};

};

view red layers;

for (var m = 0; m< thelayers.length;="" m++)="">

Layer (theLayers [m] [1], false);

};

hide the other;

for (var n = 0; n)< theothers.length;="" n++)="">

Layer (like [n] [1], true);

};

};

See the layer.

Service Layer (theID, showOrHide) {}

If (showOrHide == false) {var idHd = charIDToTypeID ("Shw")}

else {var idHd = charIDToTypeID ('Hd')};

var desc2 = new ActionDescriptor();

var idnull = charIDToTypeID ("null");

var list1 = new ActionList();

var ref1 = new ActionReference();

Ref1.putIdentifier (charIDToTypeID ("Lyr"), theID);

List1.putReference (ref1);

desc2.putList (idnull, list1);

executeAction (idHd desc2, DialogModes.NO);

};

Tags: Photoshop

Similar Questions

  • Qosmio G30-126 - how to hide/show the top bar?

    How active hide/show the top bar on the upper side desk, but disappeared how can I return it again?

    You want to have some Flash cards on top of the desktop computer?
    This isn't a problem

    In all programs-> Toshiba-> Utilities-> settings for Flash cards, you can activate this option!

    Check it!

  • How to hide/show a dynamic region

    I need to hide/show a region according to the value selected by the user from a selection list. Does anyone have anyidea about how to do it?

    Thank you!

    Create the function to hide show anywhere where you would create javascript. You can put it in a static file, html page, the model of page header that works for you.

    You must call the function of certain events on the selection list. I think that onchange would work. You can set this in the attributes of the element of the selection list element (e.g. onchange = "show_hide ()"). Or you can register the handler through javascript.

    To make it simple for you simply create the function to hide show inside a script tag in the HTML of the page header. It is located on the page at the top left region the most.

    Access to your selection list item, and then look for the "form element HTML attributes. OnChange = "show_hide () of type" in this area. "

    Greg

  • How to hide/show a field based on the data from more than 1 field?

    Hello.

    I'm trying to hide/show a based on the data of field2 and field3, Field1

    in fact using dynamic measurements I can only hide/show Field1 Field2-based, but I need a combination, for example:

    If field1 = 'A' and field2 = 'B', then see the field3, other hide field3

    y at - it an easy way to do it.

    I use Application Express 4.2.4.00.08

    Thanks in advance

    Dynamic action

    On the changes

    jQuery selector: #P1_ITEM_1, #P1_ITEM_2

    Condition: JavaScript

    $v ('P1_ITEM_1') == 'A' & $v ('P1_ITEM_2') == 'B '.

    Real Action: show item 3

    Action of false: hide item 3

  • How we hide/show the desktop in Windows 7 background?

    I managed to hide the background image.  I didn't know I would be able to watch your desktop mono color fade, and I didn't know that it is this difficult to correct!  NOWHERE in the databases Windows have people has managed to do this.  I have chosen in my slide show of photos, my memory card is fine as I got it initially, but it's really amazing to me how I can't find answers to a simple problem.

    No, he said no solid colors.  I change the selection, save and that doesn't change anything.  :(

    A final suggestion:

    Start > Control Panel > accessibility > last option at the bottom, "make it easier to focus on the task > under playback position, uncheck 'Remove background Images as appropriate' > OK"

  • How to hide/show component adf automatically

    Hi I want to auto-hide an element of the adf. I have a selectOneChoice that contain a number (from 1 to 12). Example when I select 2, it two of the field automatically without clicking any button show... I used this feature to hide a component of the declared, but just when I click on a button...


    function enableField(actionEvent) { 

      
    var nameInputText = actionEvent.getSource().findComponent("soc1"); 
      nameInputText
    .setProperty("visible", true); 
      actionEvent
    .cancel(); 
     
    } 


    I put the componement "soc1" visible = true only through the javascript function I change...

    SO the problem here is how to read the number of the selectonechoise and how to set the visible component directly without clicking on any button.

    Hello

    You still get method not found?

    your valueChangeListener is running?

    Try to use this valueChangeListener:

    {} public void socVCL (ValueChangeEvent valueChangeEvent)

    NewValue of the object = valueChangeEvent.getNewValue ();

    If (newValue.equals("2")) {}

    RichSelectOneChoice sl = (RichSelectOneChoice) JSFUtils.findComponentInRoot ("soc3");

    sl.setVisible (true);

    AdfFacesContext.getCurrentInstance () .addPartialTarget (sl);

    }

    }

    Kind regards

    Ruben.

  • How to hide/show the individual elements in a document

    I try to hide all items in a document (and store each original visibility state), iterate the elements preselected user and perform an export for each item in the selection (I've got this covered part) and finally restore the visibility of each new item state (where the initial visibility state storage is necessary).

    I found that I can browse all the elements in the document to help

    app.activeDocument.pageItems[i]
    

    where i is the page element identified by the index of the i - th in the pageItems collection.

    What is not clear, however, is how to get the visibility of this element of the page state. Indeed, there is a visbilityVariable of property associated with the elements of the page, but when I try to 'control' the content with an alert message, I get "undefined".

    Is there the best ways through all elements in a document? Ideally, I would like all the elements of access regardless of the weather, they are elements of the path, group items, items of text frame or what have you. I need this collection in the State of visibility of each item read/write. Thank you!

    "visibilityVariable" is for "data-driven graphics", regardless of those who may be. Try the property 'hidden' instead.

    JoarBolstad wrote:

    Is there the best ways through all elements in a document? Ideally, I would like all the elements of access regardless of the weather, they are elements of the path, group items, items of text frame or what have you.

    Don't worry, you got it right first time. 'PageItem' is the global superclass of all the graphic elements. Starting from the ESTK help (rather, my version as well):

    PageItem class
    A page element object.

    Superclass of CompoundPathItem, GraphItem, GroupItem, LegacyTextItem, MeshItem, NonNativeItem, PathItem, PlacedItem, PluginItem, RasterItem, SymbolItem and TextFrameItem

  • How to hide/show any attribute based on LOV?

    I have a pages that have three attribute .This following-
    1 - one is LOV
    2 input text
    3. also enter text


    If I select a value of LOV I want to hide an input text. How to achieve


    Thank you

    Published by: ADFORCLE on July 12, 2011 09:09

    If your version of Jdeveloper is not 11.1.2 checkbox
    http://www.Oracle.com/technetwork/developer-tools/jdev/listbindingvalue-088449.html

    >
    In JDeveloper 11.1.1.x, an expression such as #{bindings. JobId.inputValue} returns the number of index internal list when JobId was a list binding. To get the real value of attribute JobId, you had to use #{bindings. JobId.attributeValue}. in JDeveloper 11.1.2 it is no longer necessary, the #{bindings. Expression JobId.inputValue} returns the value of the attribute corresponding to the index selected in the list of choices.
    >

    Published by: M.Jabr on July 11, 2011 09:05

  • How to hide other layers Flash button?

    I have a swf file that has a lot of buttons on it, and when I hover over the images is displayed. But when my images appear, I have other buttons (whose layers are on top of this layer of current button) appear also on the top of my images. I tried all my buttons on a layer of the merger, but appears not to work either.

    How would I be able to not make the other buttons appear on my stationary State without using ActionScript?

    Thank you very much!

    You would either need to use actionscript so that whichever is in flat is turned to be on top of the other, or you must have your images separated from the buttons on a top layer... this too would require actionscript... to view the pictures without being part of the button.

  • How to hide/show the column in a table

    Hello world

    I have a table based on the table "Dept".
    Dept_id
    supervisor_name
    Dept_id is the LOV, and it has value (11, 12,...) (20),
    Here, when the Dept_id value is selected as 20, then the field "supervisor_name" must be posted, for the rest of the values, that it must be hidden.
    How this can be done using Jquery?
    Thank you.
    Concerning

    Look at this http://apex.oracle.com/pls/apex/f?p=46417:26

    Test/test connection

    JavaScript Code: Add in the page header > javascript

    function test(pThis) {
     //get the curren row index on change
     var currIndex = $('select[name="'+pThis.name+'"]').index($x(pThis.id));
     if (pThis.value=='20') {
      $('input[name="f01"]')[currIndex].style.display = 'block';
     }
     else {
      $('input[name="f01"]')[currIndex].style.display = 'none';
     }
    }
    

    In the element, add attributes column deptno

    onchange="javascript:test(this);"
    
  • How to hide the button according to app_user

    Hi friends,
    I have a requirement where a 'create' button will be displayed (do not allow to the) only if the APP_USER, Y. How can I do this?

    Thanks and greetings
    Umer

    What do you mean by "do not allow to the?

    You can put this in the State of a toggle its appearance button

     :APP_USER = 'Y' 
    

    Are you a programmer ex-formes? I was wondering why you want to display a button without allowing it?

  • How to hide/show panels to develop

    all my sliders disappeared on the development

    How can I restore them

    as the temp, tint, ect

    stupid, I can't do this solo

    Title of the message was edited by: Brett N

    On your keyboard, press .

    In addition, there is a small gray triangle at midway up on the right of the screen - when you click on it - active / deactivate the visibility of the side panel.

    It is same for the panels on the left and also for the other Modules.

  • How to align layers based on a specific layer

    Hello.

    I just watched this tutorial explaining everything by aligning the layers: https://helpx.adobe.com/photoshop/how-to/photoshop-align-images-multiple-layers.html#

    But, how do I align layers based on a specific layer? Let's say I have a layer about one-third from the left. I have 3 other layers, by going to halfway all the way to the right, I want to be centered based on this layer which is one third of the left, how should I do this? I want to use a specific layer as an anchor for the rest of the layers, regardless of the position of the layer anchor.

    I hope I'm using the right words, explaining what I want to do.

    Deon

    You can link layers and use one for the sorting of the anchor to speak.

    Maybe if you posted a screenshot of what you want to do.

    In any case, here is an example.

    Select the layer, press the layers of link at the bottom of the layers panel and then click on the layer in the layers panel, you want to use as anchor.

    Select the tool, then use the alignment buttons to align the blue layer in this example.

    Can also be used benchmarks commented to align the layers.

  • Can someone tell me how to show/hide multiple layers at the same time?

    Hello

    Can someone show me how to make more than one layer visible or invisible, without having to click on each separate layer? -J' have more than 100 layers in a drawing, and it is very tedious to have to click on each individual layer to hide it or show it. I just started using Photoshop elements 13, on an iMac

    Thanks for any advice.

    You can Option , click on the eye next to the thumbnail icon of the layer to hide all selected layers, but.

    Option , click New to display all layers.

    Order click to change the visibility of the selected layer switch

    To hide multiple layers, select the layers, right-click on one of the eyes, and click hide this layer

    Repeat to repeat the visible layers.

    You can also click on one of the eyes and then drag down or to hide layers and invert to make the visible layers.

  • How to hide Cluster and table nested layers

    Hello

    How we hide "layers" of clusters and berries. I tried with the range of tool with transparency, but it does not hide the overlay to imbrecated. How can I make everything look flat?

    Thank you

    What does "imbrecated" mean?

    Try to use the classic style for container controls and digital table.  When you use the transparent color on them, they will disappear.

Maybe you are looking for