selected layer

Watching to see if there is a bug on the GetLayerSelected method, or I do it wrong?

I would like to know if a given layer is selected, but regardless of its selection state, this method always send me fake back!

Here is the code:

AIBoolean isSelected = false;
result = sAILayer-> GetLayerSelected (layerHandle, & isSelected);

aisdk::check_ai_error (result);

THX, thomas.

AILayerSuite::GetLayerSelected() is only there for AI6.0 - it is no notion of a "layer selected" more. I guess you are trying to understand what thicknesses are hilited in the layers panel? If so, there is no way to get this, unfortunately. If you want to know if any art on a layer is selected, use LayerHasSelectedArt() instead.

Tags: Illustrator

Similar Questions

  • How to remove each layer except the selected layer?

    Hello

    I would like to delete all layers including the background sets and layer except for the selected layer.

    It seems easy to first, but it stops... I tried in several ways; What I am doing wrong?

    #target photoshop
    cTID = function(s) { return app.charIDToTypeID(s); };
    sTID = function(s) { return app.stringIDToTypeID(s); };
    
    app.bringToFront();
    var doc = app.activeDocument;
    var currentLayer = doc.activeLayer; // remember the selected layer
    var selectedlayername = currentLayer.name;
    currentLayer.move( activeDocument, ElementPlacement.PLACEATBEGINNING );  
    
      function DeleteLayer(layername) {  var desc1 = new ActionDescriptor();
        var ref1 = new ActionReference();   ref1.putName(cTID('Lyr '), layername);
        desc1.putReference(cTID('null'), ref1);     var list1 = new ActionList();
        list1.putInteger(17);  desc1.putList(cTID('LyrI'), list1);  executeAction(cTID('Dlt '), desc1, DialogModes.NO);
      };
    
    function DeleteBackground() { var desc1 = new ActionDescriptor();  var ref1 = new ActionReference();   ref1.putProperty(cTID('Lyr '), cTID('Bckg')); desc1.putReference(cTID('null'), ref1);     var list1 = new ActionList();     list1.putInteger(1);   desc1.putList(cTID('LyrI'), list1);    executeAction(cTID('Dlt '), desc1, DialogModes.NO); };
    
    function initial () {
    for(var i = 0 ; i < doc.layers.length;i++){    if (doc.layers[i].isBackgroundLayer == true ) {  DeleteBackground();} }
    var layerNum = doc.layers.length;
    for(var  s = 1 ; s <= layerNum;s++){
       if ( doc.layers[s].name != selectedlayername ) {   
           DeleteLayer (doc.layers[s].name);
           }
       else if ( doc.layers[s].name == selectedlayername ) {
           }
       }
    }
    
    initial();
    

    Thank you

    Best regards.

    Hi arteangelus,

    Try this Code...

    #target photoshop
    var docRef = app.activeDocument;
    var layName = docRef.activeLayer.name
    var l = Number(docRef.layers.length)+1;
    while(--l){
        if(docRef.layers[l-1].name!=layName && docRef.layers[l-1].name!="Background"){
            docRef.layers[l-1].remove();
        }
    else{continue;}
    }
    

    -yajiv

  • Can I move all the objects again selected layer without clicking hundreds of layer bars?

    I'm working on a complex illustrator file generated by GIS software. He gave me all kinds of groups of clip & road clip - what I really need, it's just to put all the same coloured polygons on the layer of a high level (unfortunately I can't draw all of my polygons in a group because illustrator doesn't pull these objects out of their existing clipping groups, and the card gets screwed completely upward if I release the clipping masks. With simple cards I have no problem Direct by selecting all of the polygons, I want, selecting their layers in the layers panel, then moving them to a new layer. This card is too complex, because there are hundreds of objects and hundreds of corresponding layers (they are not contiguous, or else I could simply click can be done with it).


    I used select > same > fill type to select all the polygons, I want that on a single layer, but I really hope that I don't have to select all the layers for each item one by one before I can move them to a new higher level layer. Does anyone know if there is a way to moving all the objects in a new layer selected without having to actually click all the layers in the Panel? Completely open to the alternative routes to my desired result!


    Thank you very much.

    Of course, after making the selection drag selection (to the right of the layer) icon on the desired layer. This will move any selected layer to the new layer.

  • keyboard shortcut. (period) disable the classification in the selected layer

    I can't get my keyboard shortcut to disable the selected layer of ranking to work. Windows has the same Mac keyboard shortcut and I'm Windows.

    I use full screen and want to turn off a layer classification but cannot. I have to go back to the main panels and turn off the eyeball for the selected layer.

    Is it me who can not get this keyboard shortcut from. (period) to work?

    If I go on my pad and think that the. (period) is there, I find myself remove the selected layer using what, in my view, could be the. (period) there.

    This keyboard shortcut was reassigned and I use a pdf of Speedgrade obsolete reference? But this one is 10/12/2014.

    Everything could find your question! Re-entered Sg, played with touches of 'standard' period and paved num. Then tried to turn the NumLock... then, rather than being a temp power gimbal, the period key just to delete the layer selected. Not like a rocker... just delete the layer. Had to go back to history (Ctrl/Com - H) back on my bed.

    Then... you can check the status of your caps lock...

    Neil

  • Help, please! I can't select the shape I drew with the pentool again... I have the selected layer, but there is no sign of my new shape in my path Panel?  I have been sitting here for days literally and simply cannot make it appear the race that I created

    HI - can help I'm going crazy! !

    I drew a shape with the tool pen (which took me Age..) and I go back an image that I imported, I cannot select once again it.  I can see it in red, but I'm not able to select once again it.  I have the selected layer, but there is no sign of it in my Panel of traces at all.  I tried clicking on the direct Selection tool (about 100 times), I tried the Brush tool.  I've tried everything.  The same thing happened to me the other day...    Please can someone help!  Tania

    It's the plug technique on the subject:

    Using Photoshop | Manage paths

    It contains this point under manage paths:

    When using a shape or pen tool to create a work path, the new path appears as the work path in the tracks Panel. The work path is temporary; You must save it to avoid losing its contents.

    OK, the red, you mentioned is a Stoke you added. Then quick mask is not involved.

  • Problem with 'Create new Extrusion of the selected layer' CC 2014

    Hello, I am experienced with Photoshop but I'm new to 3D text in Photoshop.  I type the text and convert it to a form.  When I choose to create new Extrusion of the selected layer I get the dialog, I don't see in tutorials.  It says "you are about to create a 3D layer.  You want to switch to the 3D workspace?  Yes/No, do not display again. "Which one should I use for the 3D text?

    If I choose Yes, all the panels disappear and the content in the tool options bar (Ribbon?) just under the menu bar disappears.  I have to restart Photoshop to get back on the tool options.  What could I do it wrong?

    Thanks - Dave

    I just chose 'No' and don't look at back.  I love my workspace, just as it is and doesn't prefer Photoshop to change for me in this case especially.

    You bring up the 3D Panel yourself via the window - 3D.  I think it's a good alternative for the Actions Panel, because I don't have any currently working in the 3D world.

    You'll want to see easily if you are working on 3D are 3D Panel and panel properties, among a few others.

    Regarding return your workspace as you like it...  Note the small switch near the upper right of the main window of Photoshop.  That can be used to select a workspace.  I suggest that you experiment and familiarize yourself with the concept of workspaces.  You can set your own and save it with a name, and that can really be useful.

    -Christmas

  • (Layers palette) When selected, layer is highlighted in gray, not blue.

    When I select a layer, it's highlighted in gray (in the layers palette) and I can't change it. My current process to make an editable layer is as follows:

    • Select Layer (shown in gray)
    • Double-click the layer (opens the dialog "Layer Styles")
    • Dialog box close "Layer Styles"
    • Layer is now highlighted in blue and can be edited.

    I am currently running Photoshop CS5.1 on a windows machine that uses Windows 7.

    Any thoughts?

    I just found out the problem. Somehow, I had entered in "Quick mask" mode Everything works normally now.

    Thank you.

  • Moves other than the selected layer layers

    After you select a layer by dragging in the image box and move other layers above this layer or folder of the group. The first selected layer is more selected, the affected layer is even if I was just dragging inside the picture of my initial layer box. CS4 Windows

    Two things to check for

    (1) see if the layer is locked.

    (2) If you were moving to the origin of this layer and the latter it does not move, look in the toolbar above and if the automatic selection box is checked.

    When this box is checked, you can select a layer on the image it self. This can be difficult if there is not a lot of clearance between the two layers as a small image on one of the layers. It would be possible to accidentally select the wrong layer when you try to drag. With the box unchecked, then you have to select the layer in the layer panel.

  • Is there a selected layer or not?

    Hi all

    I need a small function that tells me if there is a layer selected or not. Now I always get the active layer, even if it is not selected with this AM Code:

    getSelectedLayerId: function()
    {
      var ref = new ActionReference();
      ref.putEnumerated( charIDToTypeID('Lyr '),charIDToTypeID('Ordn'),charIDToTypeID('Trgt') ); 
      return executeActionGet(ref).getInteger(stringIDToTypeID( "layerID" ));
    },
    

    Thank you in advance!

    I think that this problem has been fixed in the latest version of Photoshop, but I have no ' t have so not sure.

    Until the most recent, you can use the following code as it checks to see if a single layer is selected by checking the visibility of the layers.

    function getSelectedLayersIdx(){
          var selectedLayers = new Array();
          var backGroundCounter = 1;
                if(activeDocument.artLayers.length > 0){
                backGroundCounter = activeDocument.artLayers[activeDocument.artLayers.length - 1].isBackgroundLayer ? 0 : 1;
                }
          var ref = new ActionReference();
          ref.putProperty(charIDToTypeID("Prpr"), stringIDToTypeID("targetLayers"));
          ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
          var desc = executeActionGet(ref);
          if( desc.hasKey( stringIDToTypeID( "targetLayers" ) ) ){
             desc = desc.getList( stringIDToTypeID( "targetLayers" ));
              var c = desc.count;
              var selectedLayers = new Array();
              for(var i=0;i 15) return selectedLayers ;
           }else{
               if(app.version.match(/^\d+/) > 15) return selectedLayers ;
             var ref = new ActionReference();
             ref.putProperty( charIDToTypeID("Prpr") , charIDToTypeID( "ItmI" ));
             ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
             if(!backGroundCounter){
                selectedLayers.push( executeActionGet(ref).getInteger(charIDToTypeID( "ItmI" )) -1);
                }else{
                    selectedLayers.push( executeActionGet(ref).getInteger(charIDToTypeID( "ItmI" )));
                    }
         var vis = app.activeDocument.activeLayer.visible;
            if(vis == true) app.activeDocument.activeLayer.visible = false;
            var desc9 = new ActionDescriptor();
        var list9 = new ActionList();
        var ref9 = new ActionReference();
        ref9.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
        list9.putReference( ref9 );
        desc9.putList( charIDToTypeID("null"), list9 );
        executeAction( charIDToTypeID("Shw "), desc9, DialogModes.NO );
        if(app.activeDocument.activeLayer.visible == false) selectedLayers.shift();
            app.activeDocument.activeLayer.visible = vis;
          }
          return selectedLayers;
    };
    
  • How to clear sticky-selection layer with the tool around in Photoshop CC?

    In Photoshop CC, you can click and drag the tool move to select more than one layer.  But sticky selection seems to be a novelty.

    In the attached screenshot, you can see that I have selected several layers of a graphic illustration.  Marquee of the move (not to be confused with the pixel-selection) tool is liked to touch these layers, but they remain selected.  Suppose that I have selected some of these layers accidentally: when I move the marquee away unwanted layers, I want than Photoshop to deselect them.  I don't want to restart a selection each time that my wrist shaking during the selection process.

    I realize that there are several ways to select layers.  I'm not looking for alternative solutions.  No sticky home or go.

    I am under Photoshop CC (2015.0.0 version) on OSX 10.11.5.

    Screen Shot 2016-06-14 at 1.44.53 PM (2).jpg

    It is in the upper left corner of your screen capture: Uncheck self-select layers.

  • I have a selected layer, and I'd like use this selection to select things in another layer. I can't find a way to do this.

    Screenshot 2016-01-11 05.41.23.png

    What I have to do is to select a single layer of color depth to select then the depths of text for just this layer. The depths of text all come in on a layer of my GIS. I manually select each and place them on their respective layers, but as you can see, which could take some time. I saved a selection thinking I might be able to use it, but it did not work. In photoshop, it was so easy, but not so much in Illustrator. I hope that I am missing just something simple here... ideas?

    I will eventually write a code in GIS software to move the strings to a layer for each of them. The depths are actually extracted a file of S - 57. They were a little difficult to understand at first, but we wrote a code to exit the depth z and convert meters into feet. If I have to color code using the current file I end up touching each other anyway.

    So the key is that this could be a plugin great idea for an Illustrator 3rd party app. I asked Astute about this yesterday, but they had nothing in mind for now.

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

    }

    }

  • Selection layer

    Hello

    How can I select all the desired layers to be grouped. I used the 'Shift' keyboard to select the 1st layer, and then click the last layer to select all. However, only selected layers are grayed out and not selected with the 'blue square point '. Please refer to my screen for a better understanding. Thanks in advance.

    layer selection.jpg

    It is not necessary to actually "select" the content of the groups or layers to combine them into a single layer. With your current selection, go to the layers contextual menu and choose "Gathering to new layer".

    If you DO not want to select content, Option-drag along the names of layers in the layers panel. This will select the content of the layers or groups. This "Drag-Select" feature was lost in an earlier version of Ia CC, but I think it has been reintroduced after complaints.

  • Move &lt; path &gt; again selected layer

    Hi all

    When I did drag to select some objects in the work plan, the < Path > touched is picked up as shown in my screen shot with a small blue square icon. How to copy all the path selected into a new layer? Thank you for any advice and assistance.

    layer selected.jpg

    You can select each object in the layers panel by clicking on where the name is, and then drag these layers highlight the other layer, or paths selected that you are now, copy (ctrl-c or cmd - c) paths, then select the other layer, then paste (ctrl-v or cmd - v) that said, I'm assuming that the mac version of the copy/paste is the same as that of windows , so I could be wrong. However by clicking the Edit menu will tell you what the shortcut keys are for copy and paste.

  • Resize a selected layer

    Hello... I'm trying to resize a layer selected, however when I select the layer I see no guidelines, no point corner to the resizing. I'm sure it's a setting somewhere. Can anyone help?

    I found it. There was a small box that says "view orders of transformation." I checked and got exactly what I needed. It's to try to help!

  • Action written in CS4 does not work properly in items 11 - contexts the 'selective' layer

    I created an action with the help of Adobe Photoshop CS4, and that it works in CS4.  When I save and load the action in 11 elements, there is a problem with the selective color layer.  The selective color layer is revealed in the stack of layers with the message whereas it cannot be edited b/c it was created in the full version of Photoshop. However, the layer itself has no changes in color/inside.

    In Photoshop, the selective color layer makes the photo look pink.  When I run the action in Elements11, selective color layer doing absolutely nothing to the photo.  I don't have the turned eye "on" to display the layer, and it is on the correct merge options & opacity (normal, 100%).

    If I run the action in Photoshop, save the file with all the layers created by the action and reopen the file in 11 elements, THEN the selective color layer shows its correct pink color.  But when I run the action as an autonomous action in Elements11, is not.

    Can anyone offer help as to why this is happening? Is there something special I need to do to make the action work in 11 elements? My understanding is that he must RUN and create the layers correctly, although some of them cannot be changed in Elements11. However, as it is, is not creating them with the appropriate color.

    Thank you in advance for your help!

    selective color layer is not supported in PSE11. So any stage to edit would result in the error message saying that the layer can not be displayed.

    For your case, I believe that the recorded action starts by creating a selective correction blank adjustment layer and then tries to change and thus translates into a mistake.

    Even the effort to apply the effect by using result of adjustments of image by mistake as the "selective" command is not available.

    I would try to find another way to apply the effect, but I don't know if there is a way to apply an adjustment layer that is not supported by PES

Maybe you are looking for