By selecting only visible layers

I'm a novice scripter, trying to find a way to hide all the layers in a document.  The document contains hundreds of layers so by selecting all and then hide everything takes far too long to run.  Is it a way to simlply button hide all or select only the layers which are visible and can hide?

Here's a way to disable all visibility of layers...

//select top layer
activeDocument.activeLayer = activeDocument.layers[0];

//toggle all other layers visibility off
toggleVisability();

//toggle this layers visibility off
activeDocument.activeLayer.visible=false;

//This function is the same as Alt/Click on a layers eye
function toggleVisability() {
var desc = new ActionDescriptor();
var list1 = new ActionList();
var ref = new ActionReference();
ref.putEnumerated( charIDToTypeID('Lyr '),charIDToTypeID('Ordn'),charIDToTypeID('Trgt') );
list1.putReference( ref );
desc.putList( charIDToTypeID('null'), list1 );
desc.putBoolean( charIDToTypeID('TglO'), true );
executeAction( charIDToTypeID('Shw '), desc, DialogModes.NO );
};

Tags: Photoshop

Similar Questions

  • Is it possible to only select the visible layers to copy/paste in place.

    Hello!

    I must be missing something.  In Adobe Illustrator, when you select a layer (or Sub-layer) to copy, is it possible to copy only visible layers and not those hidden?

    When I provide my clients with their final illustrator files, I only want to register the approved artwork.  Currently, I make a copy of the file and go through and delete hidden files, it would be much easier to copy and paste in place visible layers in an Adobe illustrator file.

    Thank you!

    Given that your items are grouped, select objects on the artboard should be as effective as Select layers in the layer panel.

    You will not be able to resolve this layer-selection-irritation. Happened for some versions. You might consider to report it as a bug.

    The link that I used to post on these occasions no longer works. Google sent me this one, I hope it works for you:

    Home

  • Select only the layers highlighted?

    Is it possible to get to the level of the layers only highlight?

    For example, I want to get an object/array that contains only the layers highlighted in blue:

    Screenshot 2015-12-20 21.40.27.png

    I'd rather not select the work to achieve this.

    Thank you!

    M

    This gives a shot.

    It will leave you with a table containing the layers you had selected in the layers panel when the script is run.

    You can see the bottom I loop this table so you can see each name and origin of visibility

    function get_selected_layers(){
        var doc = app.activeDocument;
        var lays = doc.layers;
        var OriginalLayers = [];
        for(var i = 0; i < lays.length; i++){
            OriginalLayers.push(lays[i].visible);
            if(!lays[i].visible){
                lays[i].visible = true;
            }
        }
    
        make_action();
    
        var SelectedLayers = [];
        for(var i = 0; i < lays.length; i++){
            if(lays[i].visible){
                SelectedLayers.push(lays[i]);
            }
        }
    
        for(var i = 0; i < lays.length; i++){
                lays[i].visible = OriginalLayers[i];
        }
    
        return SelectedLayers;
    
        function make_action(){
            // Set you action name and the set name that it belongs to here
            var myAction = "Select_Layers";
            var mySet = "Scripted_Actions";
            //---------------------------------------------------------------------------------
            var currentInteractionLevel = app.userInteractionLevel;
            app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
            var actionStr = [
                '/version 3',
                '/name [ 16',
                '53637269707465645f416374696f6e73',
                ']',
                '/isOpen 0',
                '/actionCount 1',
                '/action-1 {',
                '/name [ 13',
                '53656c6563745f4c6179657273',
                ']',
                '/keyIndex 0',
                '/colorIndex 0',
                '/isOpen 0',
                '/eventCount 1',
                '/event-1 {',
                '/useRulersIn1stQuadrant 0',
                '/internalName (ai_plugin_Layer)',
                '/localizedName [ 5',
                '4c61796572',
                ']',
                '/isOpen 0',
                '/isOn 1',
                '/hasDialog 0',
                '/parameterCount 3',
                '/parameter-1 {',
                '/key 1836411236',
                '/showInPalette -1',
                '/type (integer)',
                '/value 7',
                '}',
                '/parameter-2 {',
                '/key 1937008996',
                '/showInPalette -1',
                '/type (integer)',
                '/value 23',
                '}',
                '/parameter-3 {',
                '/key 1851878757',
                '/showInPalette -1',
                '/type (ustring)',
                '/value [ 11',
                '48696465204f7468657273',
                ']',
                '}',
                '}',
                '}'
            ].join('\n');
            createAction(actionStr);
            app.doScript(myAction, mySet, false);
            actionStr = null;
            app.unloadAction(mySet,"");
            app.userInteractionLevel = currentInteractionLevel;
        }
    
        function createAction (str) {
            var f = new File('~/ScriptAction.aia');
            f.open('w');
            f.write(str);
            f.close();
            app.loadAction(f);
            f.remove();
        }
    }
    
    var myLayers = get_selected_layers();
    for(var i = 0; i < myLayers.length; i++){
        alert(myLayers[i].name + ", " + myLayers[i].visible);
    }
    
  • Only visible layers illustrator of a picture

    After effects 2014.2 version 13.2.0.49

    Version of Illustrator 2014.1.1 18.1.1


    So, I started out posting in the wrong forum (Illustrator) and with whom

    question, seemed to jump that tumble down, but met with another.


    My first problem was import an Illustrator image in layers like ' Composition

    -Keep sizes layer and had to check the sequence as options

    ' PDF/Illustrator/EPS Sequence' in order to keep the layers in the right

    positions (or all the layers, centered around individual anchor points).


    Another problem I had with that was all my layers became joint - so my

    solution was to align on the comp in a manual way.


    So, now that I have the Illustrator layers in my comp in After Effects, the

    only the layers remain visible for a picture.


    I have my comp set for a minute. I started playing with opacities and cannot

    go beyond the 'visibility of an image.


    My plans are to 'draw' the guitar that I made in Illustrator, by

    Keyframing the opacity of the layer.


    I tried the wizard/Animation/keyframe sequence layers, but I

    There is something missing.


    I want to try other effects that I don't remember the name of specific effect

    (draw on the layers of guitar), but first I have to start with my

    visible for more layers then the one image.


    What did I miss?

    1. Your workplan should include all of your work. That's the problem with the illustrator file that you are showing.
    2. Import as a sequence must never be verified if you import a single file if it is imported as a sequence or a model.
    3. When you import as a model, you must open the computer that AE created to keep aligned layers.

    Most of the people just to get started with this workflow are all three of these errors. The workflow is really easy. To each object that you want to animate a separate layer, make sure that all the illustrations fits in your plan of work and you only have one, import as a model by keeping the dimensions of the layer, and then open the model AE creates. ALL of the layers in the project Panel will be the size of the layer. If you use clipping paths, then the layer will be the size of the mask of clipping if it extends beyond the work.

    One last point that I failed to do. You should create your work to make it the right size to fit in your composition to it is in rest format. In other words, if at some point in your composition, you want to see the whole guitar and have it fill the screen, then the strings should be thick enough to work in the video. This means that they must be at least 2 or 3 wide. If you want to have the filling of the guitar as a quarter of the screen and your project is 1920 X 1080 so your target must be set to 1920 pixels or points of width and strings must be still at least 2 points or 2 pixels wide, unless they are absolutely horizontal and vertical, AND if you use thin or values of race less of 3 pixels in your illustration lines You should have snap to pixel lit in illustrator. Your artwork can be vector art, but if there is fine detail of illustration, then it should be aligned with the pixel grid or it will look like not good.

  • Select only visible objects in Illustrator...

    I exported some 3D models of Cinema 4 d and I'm cleaning them in Illustrator.

    Unfortunately, the problem inherent in the export of 3D models is that each polygon/face is one exported as a separate object.

    I need to use the Scout to consolidate each pollygon into more manageable objects to paint... but it's really annoying that I have to zoom, and then select each poloygon I want to group it with the pathfinder tool.

    It would be much easier that I could set the selection tool to select only the objects visible... or rather objects which are not covered by other objects.

    Is it possible to narrow the selection in this way, when you drag an area of selection on a group of items.

    Any help would be much apreciated.

    Thank you!

    OK, I solved my problem and I am posting this to totally want to chance that somone else trying to do the same thing

    in order to get the kind of selectablilty you want to...

    • first go into your 3d software and chop your 3d model in groups you want, combined using the pathfinder, once you export to illustrator
    • Then, assign a different texture to those cut color groups so your 3d model is mainly coded in color
    • then export the model with the backfaces shot if you do not export pollygons used to be visible on the final artwork
    • one time exported, open in illustrator, using the magic wand tool to select the color of the faces groups and combine it with the pathfinder

    This process will take the required number of clickes to simplify your illustration of about 1500 clicks, at about 7

    worth.

  • by selecting all the blocks of text on all visible layers

    I want to select all the blocks of text on all visible layers.

    the script below will select all the blocks of text, even in groups, but if the layer with the text is invisible the script error. (target layer cannot be changed)

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

    var doc = app.activeDocument;

    var numTextFrames = 0;

    for (i = 0; i < doc.textFrames.length; i ++) {}

    textArtRange = doc.textFrames [i];

    textArtRange.selected = true;

    }

    }

    So I made this script to select blocks of text on only visible layers, but now missing text belonging to a group.

    var layerCount = activeDocument.layers.length;

    var docSelected = activeDocument.selection;

    for (i = 0; i < layerCount; i ++)

    {

    currentLayer = activeDocument.layers [i];

    If (currentLayer.visible == visible)

    {

    for (j = 0; j < currentLayer.textFrames.length; j ++) {}

    textArtRange = currentLayer.textFrames [j];

    textArtRange.selected = true;

    }

    }

    }

    can someone tell me why it is not some frames of text bound in a group when made this way and is it possible to get all managers of related texts selected on all visible layers?

    Thank you

    Duane

    Try this:

    if (app.documents.length > 0 ) {
        var doc = app.activeDocument;
        var numTextFrames = 0;
        for (  i = 0; i < doc.textFrames.length; i++ ) {
            try {
            textArtRange = doc.textFrames[i];
            textArtRange.selected = true;
            } catch (e) {}
            }
        }
    

    Have fun

  • Select visible layers

    Is it a Photoshop hack that lets me SELECT the VISIBLE LAYERS, ignore the (dozens and dozens of) hidden layers and CREATE A NEW GROUP FROM THE LAYERS VISIBLE?

    Hi vernehenzel,

    Please visit the following link: Possible to select all visible layers in Photoshop?-Graphic Design Exchange of battery

    Please let me know if it helps.

    Kind regards

    Tanuj

  • Photoshop CC Auto-possibilite select the hidden layers

    Hi, I am not sure if this is a bug or what... When I click on and drag with the move of the automatic selection of the multiple layers tool, it will not select only the layers that I wanted, but also layers hidden in the same area of my selection (or at least, layers, which are in the hidden groups).

    For example, say I have a layer group. I duplicate the group, and then make the original group invisible so that I can create an alternative version. When I clock and drag to select the objects in the new group, the (hidden) in the former group objects get selected as well, so I'm obliged to selection click on every article I want to change... forever.

    This is different from all previous versions of PS and a big trouble.

    If someone else can confirm this bug, or is it just me? Or not consider you this as a bug? I see some specific cases where it can be useful, but I would like to control this behavior as a preferece. Maybe there is already a preference for this problem and I just have not found. Any comments would be more useful

    See you soon,.

    Cory

    Discussing this bug here:

    http://forums.Adobe.com/message/5423270#5423270

  • AE makes only physical visible layers?

    Hello

    I will try to explain myself as accurate as possible.

    I have 3 layers in a composition. They are stacked on top of each other, and only the background layers is visible at the beginning (the other two layers are edits on by opacity later).

    I have an effect of very demanding ram/processor (camera Lensblur with 50px blur) on the layer below and no demanding effects on the other two.

    My question is now:

    After Effects takes the lower layer counts, even if it has been hidden by not demanding layers on the top, or AE only 'look' visible layers?

    Thanks in advance

    It depends on the EI version you are using. The newer versions do a better job of optimization makes.

    One way to find out how it works is to test it. Back and see if it speeds up considerably once the lower layer is totally obscured.

    I use AE for more than a decade, so I'm used to the layers of cut once they are no longer visible in order to make makes it faster.

  • Replace in selected only layers layer names

    I use this script to find and replace words in layers. (The script targets only particular words, rather than the entire layer name).

    I would like to do so it targets only the selected layers.

    I found this script that loops through the selected only layers, but I don't know how to add search and replace the name functioality layer.

    Thanks for any help that can be offered.

    Big_SmiLe wrote:

    Flipping through the guide, it does not seem to "hasSelectedArtwork", is built in function either. Are there tutorials or guides that explain how to target the selected layers?

    Wrong reference manual, see this one:

    http://www.Adobe.com/content/dam/Adobe/en/DevNet/PDF/Illustrator/scripting/CS6/Illustrator-scripting-r standard - JavaScript.pdf

    Page 91 - CHAPTER 1: JavaScript object reference

    Layer

    Property

    hasSelectedArtwork

    Value type

    Boolean

    What it is

    If true, an object in this layer has been selected; set to false to deselect all objects in the layer.

    So, as I have spoken here:

    W_J_T wrote:

    Fix. Yes there is no direct way unfortunately (like many things through script), that's why I suggested using "hasSelectedArtwork", that might work if you select the target layer in the choice of your layers you want to rename.

    and...

    W_J_T wrote:

    if(layerReferenceString.hasSelectedArtwork == true) {}

    code

    }

    Who would offer a way of knowing whether a layer is selected.

    As far as I know that is the only round about way to know if a layer is selected via the script.

  • images from the list for a visible layers only

    Hello

    I need images for the visible layers is ' true 'only. "

    i.e. document includes 10 images, but the conditions (layers visible = true) then images of document is 7.

    Trying Code:
    
    var myDoc = app.activeDocument
    
    var myGraphics = app.activeDocument.allGraphics
    
    alert("docMyGraphics " + myGraphics.length)
    
    var myLayer = app.activeDocument.layers.everyItem().getElements()
    
    for(k=0; k<myLayer.length; k++)
    {
        if(myLayer[k].visible == true)
        {
            for(i=0; i<myGraphics.length; i++)
            {
                alert(myGraphics[i].itemLink.name)
                }
            }
        }
    

    Could someone rewrite my code and give a solution.

    Please, it's very urgent...

    Thank you

    Beginner

    Hey beginner, Hey Suresh.

    http://jongware.mit.edu/idcs5/pc_Layer.html

    Each layer has its own ' allGraphics property, for a nicer way to do is to use that:

    var doc = app.activeDocument;
    var myLinks = [];
    for (var i = 0; i < doc.layers.length; i++) {
              if (doc.layers[i].visible) {
                        myLinks.push("Layer "+i+"("+doc.layers[i].name+"):")
                        var layerGraph = doc.layers[i].allGraphics;
                        for (var j = 0; j < layerGraph.length; j++) {
                                  try {                                        //  not all graphics have a itemLink, for example the embedded ones
                                            myLinks.push(layerGraph[j].itemLink.name);
                                  } catch (e) {
                                            myLinks.push("Error: Graphic " + j + " on layer " + i + " might be embedded");
                                  }
    
                        }
              }
    }
    alert (myLinks.join("\r"));
    
  • Method to select all the layers 'invisible '?

    Hello

    Does anyone know if there is a plugin or a way to select all the invisible layers in a photoshop file automatically with a single click?
    It would be really handy when it comes to huge photoshop with lots of files files and layers...

    Screen shot 2012-11-12 at 15.22.36.png

    Kind regards

    Ben

    Not sure on the hiden targeting all the layers in a single click, but you can filter so that no visible layers only show, then it is easy to target all.  (On the tab of the layer panel, choose attribute, then no Visible)

    Might be possible to write a script or an action recording to do the same thing?

  • Display only certain layers of the master by page

    Hello

    First of all, I'm pretty new to Adobe Indesign.

    I'm doing a kind of operating instructions, where all the pages are divided horizontally in three rows.

    each line can contain a certain part of the manual, it can be:

    • A step that people should perform
    • A warning
    • A graph
    • A table

    So I made a master page, with each of the four option all three rows in separate layers.

    I thought that I would be possible to turn on or turn off the layers individually for each new page, but it's not.

    each page will be the same.

    So is it possible to individually change the visible layers for each new page that I want to do?

    Or what I do with master pages for every layout possibility is it possible?

    See the image below for the layers I've done and two examples for the manual.

    Adobe Indesign CC 2015

    Windows Pro 10

    With the PDF preview, I couldn't do what I wanted to do.

    But I found how to get exactly wat I wanted originally:

    I've done several layouts on 3 rows on a page.

    Then I discovered on CC libraries:

    I selected the text field and the field of the image and recorded in CC libraries.

    Now I just take a page blank and choose the correct layout of the library

  • How can I select only only pixels in a bitmap?

    I have a bitmap image and I would select only unique pixels just floating in the negative space. Is there a way to have Photoshop select only the pixels?

    You can Ctrl/Cmd + click on the channel of the Bitmap in the Panel layers to perform the initial choices which will choose the white pixels. You can use then select > Inverse and rectangular selection tool to subtract from selection and let selected only the pixels that you want selected.

  • In Illustrator CS5, how can I select only objects * joint * by an area of selection?

    ... rather that all objects that intersect with it?  CorelDraw x 4, for example, the default value for the Pick (the primary selection tool) tool must choose all objects in the selected area.  This is extremely useful when working with vector graphics produced in other programs (e.g. Matlab) that do not already have their structured in layers of vector objects.

    I apologize if this question has been asked before, or is trivial - I'm relatively new to Illustrator.

    Thanks for any help.

    You can't do it natively, I wrote a script to work around the problem, repeat, a workaround solution, see post # 11

    How to select only the objects in a marquee?

Maybe you are looking for

  • Satellite P100-102 without digital-video output TFT-connection-Port?

    Hello We do not understand why mobile phones latest, as the Satellite P100-102 would be produced without digital-port connect TFT´s... On the market-enduser TFTs are popular, but it is not possible to use the digital interface with the portable toshi

  • Incompatibility with iTunes

    I had my (very short) life of Apple products. Currently, I have an iPhone and a pc, but I can't run iTunes on my pc without it crashing constantly. It turns out that the Apple software is not compatible. Is there a way to access/download the music an

  • Equium A110-276: cannot install virtual sound for Windows Vista

    When I'm on xp, I have a toshiba virtual sound. When I installed vista, I can not install toshiba virtual sound. It says "your computer does not support virtual sound. someone knows why? the toshiba virtual sound I install came from additional packag

  • Unable to connect to the Web Services Proxy/unused (a HP 7500 JO)

    Hello Here's the situation: Previous installer: .  I have connected my 7500 for the corporate network (IP = 172... series) .  registered the product with ePrintCenter .  used a PC under Windows to print (and scan) with the printer .  web proxy entry

  • How to program a loop to turn on or off

    Hi all I have the same code in two while controlling the four lights of loops. I use a case structure in each loop to pass two conditions (condition A and condition B). Provided that A light 1 LED in the first loop and LED 2 in the second Condition s