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);
}

Tags: Illustrator

Similar Questions

  • 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 );
    };
    
  • Select only the objects in a rectangle selection

    I am a new user of Illustrator CS5, switching from Freehand. I'm trying to find out if there is a way to select only the objects in a marquee? In AutoCAD, you can make a selection on the left window to the right and only those objects entirely in the window are selected. If you the window right on the left all the objects that are "crossed" or affected by the window are selected. Is there a similar technique in Illustrator?

    Currently, I have to select the objects, and then go back and hold the SHIFT key to deselect the object I don't want, or place objects on different layers and then lock the layers to prevent additional items get selected.

    In AutoCAD, my main program, you simply draw a window selection, left or right, depending on what your next step would be. No special tools or rocking or thinking, that's just the selection primary process and very intuitive.

    I posted a discussion on the Illustrator forum several months ago, which still arouses comments so this seems to be a tool that would be appreciated by many users. Someone posted a script but it has not worked for me yet.

    Thank you for everything that you can do to solve this problem.

    This is a copy of my last post of the original thread. I found some discussions confused because I have no experience in writing or by using scripts. So I copied all the recommendations in a document to read without the comments and digressions. After several hours and a lot of searching on Google I found what solution adapted to my goal, which was a selection process fast and simple with fewer steps to use.

    So, I think I have this job. The following is what I did:

    1 copy the script by Carlos Canto post #11 here:

    http://forums.Adobe.com/thread/856221?start=0&TSTART=0

    2. open the ExtendScript Toolkit Utilities > Adobe utilities - CS5.5 > ExtendScript Toolkit CS5.5 > ExtendScript Toolkit CS5.5.App

    3. when the program opens, paste the script in the large Panel on the left.

    4. then go to file > save as.

    5. that the dialog box click on the arrow next to the save box slot to expand the section options.

    6. next, go to Applications > Adobe Illustrator CS5.1 > Presets > en_US > Scripts.

    7. then, in the Save as box enter a name to identify the script (I named mine Window1).

    8. click on save and close the Toolbox.

    Launch Illustrator and open a drawing.

    1 using the rectangle tool, I drew a rectangle around the objects.

    2. make sure that the new rectangle is selected.

    3. I went to file > Scripts > Window1.

    4A got an error message - error 8705: target layer cannot be changed 25-> iart.selected + true line:

    Oops, you must have ALL unlocked layers.

    5. you click OK.

    6 unlocked all the layers.

    7. my new activated rectangle.

    8. went to file > Scripts > Window1.

    9 here! Items in the rectangle are selected and the rectangle is removed.

    So yes, this script works as requested. Thank you, Carlos.

  • How to select only the objects in a marquee?

    I am a new user of Illustrator CS5, switching from Freehand. I'm trying to find out if there is a way to select only the objects in a marquee? In AutoCAD, you can make a selection on the left window to the right and only those objects entirely in the window are selected. If you the window right on the left all the objects that are "crossed" or affected by the window are selected. Is there a similar technique in Illustrator?

    Currently, I have to select the objects, and then go back and hold the SHIFT key to deselect the object I don't want, or lock layers to prevent additional items get selected.

    NO.

  • How to select only the URLS in the same page

    I'm used to be able to select only the URL with right click of the entire page. After reinstalling Firefox, I can't use this feature more. Please let me know what kind of add-on, I need to have. Thank you

    I looked in the Wayback Machine for an older version of this page. He said:

    Multi links allows you to open, copy or favorite of several links at the same time rather than having to do them all individually.

    To open, links copy or bookmark, you simply right-click and do to drag a rectangle around the links to the desire to act. When you release the right mouse button, you will open/copy/bookmark these links.

    Note: The Wayback Machine does not cache downloads real extension due to the limitations of robots.txt on the site of modules.

    One of these current extensions could be partial replacement:

    I have not tried any of them myself.

  • I'm trying to create one named calculation in a field, but not able to select only the required fields, other than all or not.

    Hi all

    I installed "Acrobat Standard DC".

    I've been working on a PDF file to filliable form.

    Then tried to make a calculation in a field, but wasn't able to do.

    When you set up, I was not able to select only the necessary fields.

    field-select_0.pngfield-select_1.png

    I have only be able to select all or not!

    Is that what I'm doing wrong?

    Even trying in "simplified... field. "it doesn't work.

    Thanks for any suggestions!

    Use the space bar to select a single box.

    Wednesday, July 29, 2015, at 14:16, supporth66519991 [email protected]>

  • Filter in adobe bridge to select only the Raw files to DNG format convert

    Here's my problem - I have a new camera DMC TZ70 and 5.7 Lightroom does not recognize the. RW2 files. I would need to buy LR6! Maybe later.

    So I thought that I import via the bridge and convert to DNG.

    So I open the bridge, and then select the camera - great - BUT there are files for Raw, the same number of JPEG files images and some .bdm. TDT etc files. (for example 3 raw + 7 others).

    I can set up a filter to Show only Raw files when I see what files are in the folder of the card at the Bridge, but when I select "get photos from camera" I can either select all OR deselect and then I need to MANUALLY select raw files. There seems not to be a way to set up a filter in the form of Downloader so that bridge selects only the Raw files for conversion.

    If I left it all, Bridge Converts the RW2 in DNG files, but also provides in the JPGs and other files. I can delete these later, but this seems an inefficient way to do it.

    Is it possible to manually select raw files in the form of Photo Downloader?

    Advice please, thank you, Mel

    I guess the answer's bridge doesn't do what I want, but not Lightroom - bought LR6

  • I have problem in the PDF export to save only the layers appeared only. When I export the indesign file to PDF that contains layers hidden pdf placed, pop up problem when I use the search field in exported pdf file. hidden text of hits from search results

    I have problem in the PDF export to save only the layers appeared only. When I export the indesign file to PDF that contains layers hidden pdf placed, pop up problem when I use the search field in exported pdf file. hidden text of hits from search results to laye

    I answered your question: there is nothing you can do in InDesign. You need to ask in the Acrobat forum I linked.

  • How can I change the color of a layer selected in the layers of grey to blue Panel?

    When you work on an image editing in Photoshop CC 2015, the layer in the layers panel highlighted is a gray color.  In tutorials, it appears as blue.  How can I change the color in my layers panel so the highlight layer is blue, not gray?

    I don't think there is an option to set the highlight color for the selected layer - the shift from blue to gray was introduced between 2014 Ps and Ps 2015, tutorials where you see the highlighted in blue are probably just be using an older version of Photoshop.

  • 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?

  • export only the layers visible illustrator in png

    I try to save illustrator layers specific and visible in a png (for placement in PPT) file.  However, all of the layers in the document continue to appear in the png.  I even went in and deselected layer options 'show' and 'print' and they all will continue to appear. What I am doing wrong?  Is the only option to save as a jpg file? The ultimate goal is to be able to save the layers transparent for placement in PPT as relies.  Any help/info would be appreciated!  Thank you!

    I don't see a function to export of goods.  My art Board is created to measure and I was using ' file - export as "png, but I now try to save to the Web option.  Thank you.

  • How to select only the part by using the sql query

    Hello

    I have the task to retrieve only the integral of the input text by using the sql query.

    The entry is as follows

    Entry for the price setting

    $12.5 (FYI without space)

    $ 12.5 (FYI single space)

    $ 12.5 (double space FYI)

    $12.5 (FYI multiple space)

    $12.5 (FYI multiple space)

    Output expected of 12.5

    The price is the type varchar2 column in the store_price table.

    Please let me know how to achieve this.

    Thanks in advance.

    If this is always the case that you get a $ followed by a number of places, you can use something like:

    Select to_number (ltrim ('$ 12.5',' $')) DOUBLE

    or

    SELECT ltrim ('$ 12.5',' $') OF double

    but take care of your nls_numeric_character settings if they are defined so that, for example, a comma is the decimal separator, you will have a problem.

    HTH

  • How can I select only the lowest layer?

    On the Adobe site, he States:

    If you need the lowest layer selected, press Option + shift + -[.]

    Well, it does not work for me in all cases as if another layer is selected, both end up being selected.

    Inside of an Action, how can I select the lowest layer and only the lowest layer?

    And while I ask questions of Action, in an existing action, how do I start recording so that the new shares are placed right at the top? If I select the name of the Action, the new record is placed in the lower part. If I select the first element, the new record is ranked second.

    See if Option +, (comma) selects the lower layer.

    And Option +. (period) selects the top layer.

  • Extra page prints when I print selects only the pages in a pdf

    When I have a several page pdf and I want to print less than the full document, my print job always starts on an extra blank page at the end. If I print the entire document, it does not generate an additional page. I've tested this in Word and Word prints only the pages with none of the additional pages.

    Any ideas what the problem may be?

    Thanks for your help.

    Sorry I'm late getting back. I solved the problem, so in the interest of those who may encounter this problem later, I write I find the solution.

    I tried your suggestion first and second. None worked. I could not try the third suggested fix that I'm on a work computer and apparently did not have the administrative rights to create a new user account (at least, I couldn't figure out how to do).

    After a lot of digging and experimenting, here's what has worked in the end.

    Start > devices and printers > right click on the printer > printer properties > Advanced tab > uncheck "Enable advanced features of print" > apply > OK.

    I have determined that, somehow, it was a problem of separator page, but it's the only way I could find to disable the separator page.

    Hope this helps someone in the future.

  • Can I use automatically select only the first line of a legend to include in the list of Figures?

    Is there a setting in the FAKE ID CS6 utility that will allow me to use only the first sentence in a legend to include in a list of numbers?

    Example of

    Willard Wharf, Cocoa, Florida, 1887.   It was the first blah blah blah of cocoa.  Photo by a dead guy.  with the permission of a lovely old lady whose grandmother collected it.

    In the example above, the whole passage is currently formatted with a paragraph style sheet in the Arno Pro Caption.  When I'm done, I would like to have this first phrase or sentence in "BOLD", which I planned to do with a character style sheet.  The rest will be normal.

    Now I understand more how the TOC utility works, I wonder, can I do a paragraph for the sentence of the title style and a second paragraph style for the remaining text in the legend that follows in the affirmative, how to make sure that the second paragraph will follow on the same line where ever the first paragraph style ends?  Nested styles, perhaps?  If the nested styles are the way to go, any comments or pointers to the simplest strategy to do this work will be appreciated.

    Legends do not match.  Some have a name and date; others are a title phrase or sentence, follow, sometimes up to several sentences.  In General, however, there is only one sentence after the title. I also usually a "courtesy of...". "statement recognizing the source of the photo.

    I'm a newbie using id cs6, for the first time, to format a book.  I'm enjoying using the program, but some details lead me sometimes at a stop.

    Thank you

    Roy

    If the TOC utility will choose paragraph or character style?

    If so, I'm good.  But the instructions in the site of Adobe and 2 manuals that I speak using paragraph styles.  The ones of my choice list.  Will have to do an essay on character styles.

Maybe you are looking for