Layer group visibility toggle

With the help of this forum I obtained a script  which toggles the visibility of a specific layer without  selecting the layer.
I would like to find out if the same functionality can be achieved for a layer group.
In other words can script toggle the visibility of a layer group with out actually selecting the layer group?
I understand some parts of Photoshop are not scriptable and wan to make sure this isn't one of them before I embark in creating the script.

I have a script that does what you need. Can't remember if I obtained it from here, but I do know that the scripting guys in here are geniuses and can help you out with almost anything. That said, here is the script that you need. All you need to do is replace the three "Insert Layer Name Here" portions with the name of the layer you wish to toggle on/off. Don't thank me, thank whoever wrote it, (most likely someone here)
var targetID = getLayerIDByName('Insert Layer Name here');
if(undefined != targetID){
    if(getLayerVisibilityByID( targetID ) ){
        hideByName('Insert Layer Name here');
    }else{
        showByName('Insert Layer Name here');
function getLayerIDByName(name) {
    try{
    var ref = new ActionReference();
    ref.putProperty( charIDToTypeID("Prpr") , charIDToTypeID( "LyrI" ));
    ref.putName( charIDToTypeID( "Lyr " ), name );
    return executeActionGet(ref).getInteger(charIDToTypeID( "LyrI" ));
    }catch(e){}
function getLayerVisibilityByID( id ) {
    var ref = new ActionReference();
    ref.putProperty( charIDToTypeID("Prpr") , charIDToTypeID( "Vsbl" ));
    ref.putIdentifier( charIDToTypeID( "Lyr " ), id );
    return executeActionGet(ref).getBoolean(charIDToTypeID( "Vsbl" ));
function hideByName(name) {
    var desc = new ActionDescriptor();
        var list = new ActionList();
            var ref = new ActionReference();
            ref.putName( charIDToTypeID('Lyr '), name );
        list.putReference( ref );
    desc.putList( charIDToTypeID('null'), list );
    executeAction( charIDToTypeID('Hd  '), desc, DialogModes.NO );
function showByName(name) {
    var desc = new ActionDescriptor();
        var list = new ActionList();
            var ref = new ActionReference();
            ref.putName( charIDToTypeID('Lyr '), name );
        list.putReference( ref );
    desc.putList( charIDToTypeID('null'), list );
    executeAction( charIDToTypeID('Shw '), desc, DialogModes.NO );
EDIT- whoops, I just realized this is only for layers, not groups. But hopefully it's a starting point

Similar Messages

  • Toggle Group Visibility while sorting results in error

    I have a custom website in which we have embedded SQL Server Reporting Services reports.  
    The report in question has 3 nested row groups.  The parent group is always shown, but the 2 child groups default to hidden and have their visibility toggled by the parent group.  This works fine by itself.
    There are several columns for which we've enabled Interactive Sorting.  This also works fine by itself.  
    The problem occurs when the user sorts a column first, then toggles the visibility of the child groups.  Toggling the groups before sorting works fine for some reason.  The Error only occurs when sorting, then toggling visibility.
    The error is a reporting services error.  It says 
    The value for parameter 'SortItem' is not specified. It is either missing from the function call, or it is set to null. (rsMissingParameter) Get
    Online Help
    There is no parameter in the report called "SortItem", so this seems to be some internal error which is triggered from this specific sequence of events.
    Additionally, this error only occurs when the report is embedded in the custom website.  This error does not occur when running the report in the standard reporting server website or in Visual Studio.  
    Any ideas on how to fix this?

    Hi Jahbreeze,
    Thank you for your question.
    I am trying to involve someone more familiar with this topic for a further look at this issue. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated. 
    Thank you for your understanding and support.
    Best regards,
    Qiuyun Yu
    Qiuyun Yu
    TechNet Community Support

  • Illustrator CS6 - hard to toggle layer lock/visibility

    Just wondering if anyone else is finding it more difficult to toggle the layer lock/visibility in CS6 than in the earlier versions.
    It seems that there's more padding around the lock/visibility icon, and you have to be really precise to click it... increasing the row size doesn't really make any difference, as the "padding" is still there. Wheres in the earlier versions clicking anywhere within the toggle box would enable/disable it.

    Yes I've seen this. But it's not related to precision here. It's a matter of double-clicks. The toggles don't respond well when you click more than once in the same location. You may find if you click... click somewhere else... then click the original location again it works better. This seems to be true for not only the Layers Panel, but also the Appearance Panel.
    I have filed this as a bug. Hopefully it gets looked into soon.

  • Layer/OCG Visibility based on Combo Box Selection

    Hello,
    I'm VERY new to javascript, so please bear with me.  I have a combo box with multiple selections.  For some selections, I would like a separate OCG layer to appear, and with other selections that same layer to disappear.
    For example:
    ComboBox1: A, B, C
    Layer 1 default: hidden
    A - toggle layer 1: hidden
    B - toggle layer 2: hidden
    C - toggle layer 3: visible
    I have seen the javascripting involved turning layers on/off with buttons, but I'm having some difficultly with the combo box. 
    Thanks!
    Mike

    The code would be much the same as with buttons. Use the Validate event of the combo box to get the selected value (event.value) and show/hide the appropriate OCGs. If the combo box items have export values, you'd use the Keystroke event so you can get the export value of the selected item via the event.changeEx property: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.607.html

  • Moving a layer group should not incure a performance hit (init a set of layers vs recursive)

    I have finally taken the time to understand the behavior of the slughish performance of moving layer groups.
    On my computer in CS6:
    1. If I have just 2 layers in a layer group. Selecting both of them and ctrl-dragging them around is smooth and responsive.
    2. If you have however select the layer group which contains just these 2 layers, the performance is obviously and terribly impacted. The drag is slow and choppy. With just 2 it is unbearable with regards to workflow but with a large layer group the performance it is utterly unusable. I am now looking to test what occurs in older versions.
    I am a programmer. Not only that, I am a programmer who regularly targets 16 milliseconds on the scene and model graph. Learn to code and learn to program with hitting a 16ms user experience. That means abstraction culling to perform a minimum number of operations for a feature vs inertia, not the logically beautiful and sound abstractions we all would love to have on infinite computation. That's the reality of performance optimization. Performance optimization should be refered to as abstraction culling because that's what it is.
    It should not make any logical difference how a set of layers is initilized for a transform. Please initialize the arrayed set of layers from the hierarchy of groups instead of executing your obviously flawed and unoptimized recursive routine.

    I'm just not seeing a difference in performance between dragging a single layer around, multiple individually selected layers together, or a whole group of layers (where the group is what's selected in the Layers panel).
    I tested on both Photoshop CS6 and CC.  I'm on Windows 8.1.  And I can honestly say I've never seen the layers panel scroll slowly.
    That's not to say I'm seeing instantaneous, smooth moves of layer data - with a sufficiently large image, the update rate goes down to where the frame rate of moving things is quite visible - e.g., 4 or 5 frames per second - but that's still interactive, and it has always been like this with Photoshop as far back as I can remember.  If anything, moving data around has gotten a bit snappier in Photoshop CC.
    You may well have something specific going wrong on your system, or with your particular document.
    Why not post a copy of a specific test image on which you can reproduce the issue, and that you'd like others to test with.  I'll be happy to drag layers and groups around in it and report back.
    That reminds me, I need to get software installed to capture my desktop as a video, as I need to make a training video soon.
    -Noel

  • Layer Group Channel blending, incorrect colors

    Hello!
    Wanted to bring up an issue that has troubled me in Photoshop for years, with the hope of it gaining some traction for fixing. For a while now (unsure which version), it was possible to set a Layer Group to filter/isolate a specific channel. This is a very useful feature for me, in creating channel masks for game assets and for use in real time shader techniques. However, it has a very large flaw that has made the feature largely unusable - and I'm surprised others have not had the issue as well as it should affect print as well (if in a lesser effect).
    When you use this feature, and essentially mask the contents of a layer to the Red, Green, or Blue channels, the layers in those Groups are still hit by color management, which results in the pixels drawing and blending incorrect colors. an example:
    In the first file, each group is set to blend to a specific channel, and a black to white gradient is applied in that layer.
    In the second file, those same layers are copied and pasted into the channels of a new RGB document. The file already looks very different.
    Finally, in the 3rd file the two layers are compared using the Difference blend mode. Can observe the difference between the two layers here, which is a result of the first method (Layer Grouping) not blending the pixels properly as if they were a channel - which when using the R/G/B blend masking on Group Properties, is what should be expected.
    When i use this technique of pushing certain black and white images into a channel, they are made for a specific purpose and function. Since the layer group blending alters what the values of those pixels are (very important for real time shader creation) in the final file, it makes this amazingly useful feature unusable. I would LOVE to be able to have Layer Group channel blending be a part of my workflow, instead of constantly copying and pasting into channels. I have created various scripts to save these types of files out easier, but i could greatly simplify them by being able to save this 'RGB Mask' file directly from my PSD.
    Wanted to share and start a discussion about it, to see if it would be possible to get a fix for this in the future!
    thanks!
    Maury

    don't generally like to bump threads, but bumping for some visibility and maybe some insight?

  • Script progression caught on Layer Group Parent

    I have this code to progress down a doc and offset - it gets caught on Group Folders - the LayerSet Parent Node. Anyone have an idea how to rephrase this - to get it to progress past the layer group folder and on to the next layer?
    for (var i=0; i<srcDoc.layers.length; i++) {
    if (srcDoc.layers[i].visible) {
    srcDoc.activeLayer = srcDoc.layers[i];
    if (srcDoc.activeLayer.kind != LayerKind.TEXT){
    Offset();
    else{
    srcDoc.activeLayer = srcDoc.layers[i];

    You can wrap that in a function that runs itself when a LayerSet is encountered.
    Maybe this can illustrate the point:
    Re: Layer Sets (groups)

  • Make layers in group visible by clicking 1 time

    How can I make all the layers in a group visible by a shortkey or one click. (instead of clicking on each single eye-icon of the layers)
    (I have problems with layercomps and when I switch to another layer comp the groups become visible but not the content of the group. Is this a bug?)
    Thanks!

    How can I make all the layers in a group visible by a shortkey or one click. (instead of clicking on each single eye-icon of the layers)
    (I have problems with layercomps and when I switch to another layer comp the groups become visible but not the content of the group. Is this a bug?)
    Thanks!

  • How to get Layer's visibility status?

    Ii I know the class name & UID of an item on a indd file, how can i get it's visibility status?
    I tried to do it like this as shown in a nexample,
    InterfacePtr<ISpreadLayer> spreadLayer(::GetDataBase(unknown), hierarchy -> GetLayerUID(), UseDefaultIID());
    if(spreadLayer != nil)
    bool visibleFlag = spreadLayer->IsVisible();
    but above code gives 'true' even for invisible items.
    please let me know what is the wrong?
    Thanks

    Hi Dirk,
    Thanks for your rich reply.......
    I agree with you, before get in to SDK we should have a better knowledge on that. I've gone through programming guides as much as pssible. but still have a lot more to know..
    My requirement is to get layer's visibility(that is shown from 'eye' symbol in layer panel).
    when i use'
    InterfacePtr<ISpreadLayer> spreadLayer(::GetDataBase(unknown), hierarchy -> GetLayerUID(), UseDefaultIID());
    if(spreadLayer != nil)
    bool visibleFlag = spreadLayer->IsVisible();
    It  shows only 'Layer1' status, But I can't get Layer1's item's(root items or child items) status. Do you have any idea about how to get root item's layer visibility status?

  • Photoshop CC 2014 hangs for nearly 15 seconds when using Layer Group Layers or Layer Palette Group from Layers commands.

    Photoshop hangs for nearly 15 seconds when using Layer > Group Layers or Layer Palette > Group from Layers commands. NOT on creating new group and creating layers and drag-n-dropping layers into group manually in Layer Palette. Got a UI design file with nearly 800 layers and lot of groups. This doesn't occur in smaller files. Using OS X Mavericks, Photoshop CC 2014.2.2, Mid 2014 15-inch Retina Macbook Pro.
    I understand that the solution would be just to cut the file into smaller files and design each UI view in a separate file but that would be painful. And it does not seem to be a very hard task to just group layers.

    Does the document also have a lot of layer comps?
    And can you post that document or send me a copy of it so we can see exactly why it is hanging?

  • Importing layer groups from photoshop to flash cs4

    Hi everyone,
    I have about 5 layer groups in Photoshop and in each of the groups/folders there are some layers with some text and other layers with isolated images and also layers with some layer styles. When I import this file into Flash I need each of the layer groups to be imported as a flattened bitmap image. I don't want any of the text to be editable or to have any of the layer styles intact. So if there are 5 layer groups in Photoshop, I just need five bitmap images in flash. I've tried doing this but it still imports the layers separately. I know I can flatten the groups in Photoshop but I want to keep this file editable.
    Does anyone know how to do this?
    Appreciate any help.

    Harry Kunz wrote:
    Then why not flatten it (BUT not save it) and import it into flash THEN revert the photoshop file (CTRL+Z) so it will still be editable version?
    Yeah I know that's an option but I just thought there might be a quicker way, but maybe not.
    Thanks for the suggestion though.

  • PSE 10 Can't edit read-only layer groups (a.k.a.  I just want to make a custom DVD menu in Elements)

    A little background: I wanted to make a custom menu so I opened a copy of one of the canned menu.PSD files in PS Elements 10.  It opened up with all layers and their sublayers showing.  So far, so good.  I did a bunch of editting and had my menu just about right, saved it and burned a DVD with it.  I saw some corrections that I needed to make so I opened the same .PSD file and it showed all the main layers (with the folder icon) but not the attached layers. 
    I double-clicked to open these layers and got:
    "You are attempting to open a group, which is not supported in Photoshop Elements.  The layers in this group will be simplified into a single layer.  Simplify the layers? Yes No."
    I was just editing these things the day before yesterday.  All I've done since then is register my software online. I have seen it stated in this forum that "Elements doesn't support layer group/sets" but it was referring to an earlier version I'm guessing.
    Question 1:  Is this still true of PSE 10?
    Question 2:  If so, how was I editing them the other day? 
    Thanks in advance for any help you can offer.
    Joe

    If you haven't uninstalled premiere elements then it should work, but there are a few things that will not work when editing the dvd templates:
    (it only works on certain dvd templates and only on a machine with premiere elements installed)
    *If you change the document dimensions either larger or smaller. (not the size of the elements in the template but the overall size such as using
    Image>Resize>Image Size or Canvas Size)
    *If you delete any of the layer groups
    *Changing the name of the document
    There are probably other causes and they may know more on the premiere elements forum:
    http://forums.adobe.com/community/premiere_elements?view=discussions
    MTSTUNER

  • Layer Not Visible in IE

    Hi --
    On this page:
    http://catenion.thelegatogroup.com/secondary.htm
    I have an
    abolutely positioned DIV (#secnav) within the DIV #banner. In
    FF the layer
    displays as it should. However, in IE it's not there. This is
    one of the
    few times I've used layers, and I'm not sure how to go about
    fixing this.
    Can someone take a look?
    Thanks,
    John

    The thing is, I didn't have a horizontal scrollbar which I
    think is odd.
    "Ken Binney" <[email protected]> wrote
    in message
    news:fhlfq1$bss$[email protected]..
    > Well, your code said it had to be there (somewhere)
    > and a browser view, with a huge horizontal scrollbar
    told me where to look
    > *grin*
    >
    >
    > "Tarvardian" <[email protected]> wrote
    in message
    > news:fhkarp$p0h$[email protected]..
    >> Hi Ken --
    >>
    >> Yeah...that's what Osgood said. How did you find it
    there? I couldn't
    >> see any hint of it.
    >>
    >>
    >>
    >> "Ken Binney"
    <[email protected]> wrote in message
    >> news:fhkak3$olt$[email protected]..
    >>> The layer IS visible in IE, however it is
    positioned WAAAAAY off to the
    >>> right of the page.
    >>>
    >>>
    >>>
    >>>
    >>>
    >>> "Tarvardian" <[email protected]>
    wrote in message
    >>> news:fhk92p$mk3$[email protected]..
    >>>> Hi --
    >>>>
    >>>> On this page:
    http://catenion.thelegatogroup.com/secondary.htm
    I have
    >>>> an abolutely positioned DIV (#secnav) within
    the DIV #banner. In FF
    >>>> the layer displays as it should. However, in
    IE it's not there. This
    >>>> is one of the few times I've used layers,
    and I'm not sure how to go
    >>>> about fixing this.
    >>>>
    >>>> Can someone take a look?
    >>>>
    >>>> Thanks,
    >>>> John
    >>>>
    >>>
    >>>
    >>
    >>
    >
    >

  • ? on moving items within layer groups

    i am having trouble using layer groups. I have a layer group named Group 1 with 5 layers in it. Each layer contains 1 image. I'm unable to move 1 layer to center the image without all the other layers taking on the same position.Even if they aren't turned on, or selected. The only layer selected and turned on is the layer i want to move the image.
    I don't have a lock on. Even if i turn off the other layers, once i turn them on again, poof - they all position incorrectly.
    How can I turn off this glue type action from happeing?
    Thanks!
    Marley

    I've never seen anything like the behaviour you are describing.
    The only things that will cause layers to move together are the following conditions…
    selecting multiple layers in the panel
    Linking them as mentioned before (see the small link incon at the bottom of your layers panel)
    highlighting and moving a group. This means using the move tool when a layer GROUP is highlighted not an individual layer
    Your screen shot impies that none of this is happening. Reset your photoshop preferences by holding command option shift while launching the application.

  • Layer group blending modes

    There was some discussion about defaulting layer groups blending mode being normal by default instead of pass through. While I do use a lot of smart objects as "normal" containers (albeit mostly to filter rather than blend), I'm interested in techniques which would make normal a more useful default. Any thoughts?

    OK... Here's my 2 cents. I use layer sets (layer groups) often in color correction work. Some times to get color where you want it, you may need to use 2 or 3 adjustment layers. For instance a Hue Saturation layer and a Curve layer. rather tan masking both of them, I put them into a layer set, and make one mask at the set level. This is helpful if later you need to extend the correction to include additional areas... all you need to do is modify one mask. In this situation, the layer set has to be set to pass through in order to affect pixels below it.
    Now, lets say I grabbed a head from a different image, to add a person to the image I started with. If the head requires brightening and color adjustments to make it match the existing image, I find it a little neater to place the head layer in a layer set, then all the adjustment layers can go inside the set with it. But I need the blend mode of this set to be normal, so that the effects of the adjustment layers within it do not continue past the set level. Make sense?
    I realize that you can link the adjustments to the layer you intend to affect, but I find the method I described to just be a little neater as far as layer management. AND if I then need to paint in hair for the head layer and paint in some eye enhancements, I can do each on its own layer inside the set. Sometimes I'll make the blend mode of the layer set for the head (just to stick with the same example) normal then put all my color adjustment layers inside a sub set with a blend mode of pass through. Then I can mask the CC layer set to only CC the eyes let's say, and I can mask the head layer set separately to blend it into the scene.
    I hope all that helps. :^)

Maybe you are looking for

  • Error: Automatic tick on FOC indicator while creating Purchase order

    Hello All, Our client is going through one issue that when they are creating PO by ME21N,after putting PR and line item and plant,it is automatically ticking on FOC indicator and then in invoice tab the field Inv.Receipt and GR based IV  automaticall

  • Remove XML tags from XML element in Oracle

    Hi, I have a requirement where I have to remove all the xml tags from xml element with banks, currently I'm using replace 4 times to replace all different types of xml tags, performance is really bad. is there any better option to remove xml tags fro

  • My serial number wont work when reinstalling the software.

    I recently reinstalled Ai CS3 and my serial number is not working. Anyone have an idea as to why?

  • Open file in IE

    Hi all. how can i open a file in internet explorer from my java program? many thanks

  • Reinstalling Mac OS X Lion

    Hi everybody! I have to say that I m very dissapointed with Apple! I bougth the Lion OS a week after it was launched and downloaded it from the app store! I am trying now to redownload it so that I can perform a new clean install but cant seem to fin