Layer Sets (groups)

Hi fellas. It's been a while!
I tend not to use groups (layer sets) myself, but other people do. I've got several scripts that loop over all layers in a psd and then peform various tasks.
Of course they fall over if layersets are involved; so I need to change that.
To test this out I wrote a script and made a simple psd; New document (any size), background, one layer (called "layer 1") and another layer ("layer 2") which is in a layer set ("a_group")
I've got a basic script here that loops through all layers (or so I thought)
<code>
var srcDoc = app.activeDocument;
var numOfLayers = srcDoc.layers.length;
for (var i = numOfLayers -1; i >= 0  ; i--)
{    var layerName = srcDoc.layers[i].name;
    // check for groups
    if (srcDoc.layers[i].typename == "LayerSet")
    alert (layerName + " is a group")
    else
    alert (layerName + " is not in a group")
</code>
The alert calls all layer names as it goes up the stack. It however misses out layer 2 (which is in a group) So what am I missing out?
Cheers

I think you need a function that calls itself, because Layers in LayerSets are children of the LayerSet and not the document.
var theLayers = collectLayers(app.activeDocument, []);
alert (theLayers.join("\n"));
////// function collect all layers //////
function collectLayers (theParent, allLayers) {
          if (!allLayers) {var allLayers = new Array}
          else {};
          for (var m = theParent.layers.length - 1; m >= 0;m--) {
                    var theLayer = theParent.layers[m];
// apply the function to layersets;
                    if (theLayer.typename == "ArtLayer") {
                              allLayers.push(theLayer)
                    else {
                              allLayers = (collectLayers(theLayer, allLayers))
// this line includes the layer groups;
                              allLayers.push(theLayer);
          return allLayers

Similar Messages

  • Changing from "Pass Through" as Default in Blend Mode in a Group Folder Layer Set

    Hello Forum gurus!
    Using a MacBook Pro, 10.5.4. Painting with CS2. My question is two-fold.
    When the Group layer folder in a layer set is selected, it is displaying the "Pass Through" blend mode by default. Is there a special convenience to this? (Best use for pass through blend mode)
    Also, How may I change the default in this mode to be "Normal" as the setting when creating a Group folder layer set?
    Thanks!!
    Colene

    Matthias, now I understand. We're both right from different perspectives. If you want the adjustment layer (should there be one within the group) to affect all layers below the group (perhaps because that's the way the image looked before you made the group in the first place), then Pass Through is your blend mode. If you want that adjustment layer to affect only those layers within the group (which I often do), then Normal (or some other) is your blend mode.

  • Problem with layer sets opening

    Hi,
    I have a problem open layer sets. In my script I get layers index and then iterate throught this layers.
    Here is the script:
    function getAllLayersByIndex(){
           function getNumberLayers(){
           var ref = new ActionReference();
           ref.putProperty( charIDToTypeID("Prpr") , charIDToTypeID("NmbL") )
           ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
           return executeActionGet(ref).getInteger(charIDToTypeID("NmbL"));
           function hasBackground() {
               var ref = new ActionReference();
               ref.putProperty( charIDToTypeID("Prpr"), charIDToTypeID( "Bckg" ));
               ref.putEnumerated(charIDToTypeID( "Lyr " ),charIDToTypeID( "Ordn" ),charIDToTypeID( "Back" ))//bottom Layer/background
               var desc =  executeActionGet(ref);
               var res = desc.getBoolean(charIDToTypeID( "Bckg" ));
               return res  
           function getLayerType(idx,prop) {      
               var ref = new ActionReference();
               ref.putIndex(charIDToTypeID( "Lyr " ), idx);
               var desc =  executeActionGet(ref);
               var type = desc.getEnumerationValue(prop);
               var res = typeIDToStringID(type);
               return res  
           function getLayerVisibilityByIndex( idx ) {
               var ref = new ActionReference();
               ref.putProperty( charIDToTypeID("Prpr") , charIDToTypeID( "Vsbl" ));
               ref.putIndex( charIDToTypeID( "Lyr " ), idx );
               return executeActionGet(ref).getBoolean(charIDToTypeID( "Vsbl" ));;
           var cnt = getNumberLayers()+1;
           var res = new Array();
           if(hasBackground()){
        var i = 0;
              }else{
        var i = 1;
           var prop =  stringIDToTypeID("layerSection");
           for(i;i<cnt;i++){
              var temp = getLayerType(i,prop);
              if(temp != "layerSectionEnds") res.push(i);
           return res;
           function getLayerVisibilityByIndex( idx ) {
               var ref = new ActionReference();
               ref.putProperty( charIDToTypeID("Prpr") , charIDToTypeID( "Vsbl" ));
               ref.putIndex( charIDToTypeID( "Lyr " ), idx );
               return executeActionGet(ref).getBoolean(charIDToTypeID( "Vsbl" ));
    function makeActiveByIndex( idx, visible ){
        var desc = new ActionDescriptor();
          var ref = new ActionReference();
          ref.putIndex(charIDToTypeID( "Lyr " ), idx)
          desc.putReference( charIDToTypeID( "null" ), ref );     
          desc.putBoolean( charIDToTypeID( "MkVs" ), visible );
       executeAction( charIDToTypeID( "slct" ), desc, DialogModes.NO );
    var groups = getAllLayersByIndex();
        for(var i = groups.length-1; i >= 0 ; i--) {
          makeActiveByIndex( groups[i], true );
          ....working with layers....
    I think, my problem is in function makeActiveByIndex, because it doesn't make active a folder and doesn't open it.
    You can see it on this picture. Active layer set is "Skupina 1" and it is in layer set "hlavicka". But "hlavicka" is not open. WHY??
    Can you help me fix this problem??
    Thank you Domaneni

    Hi, for the past days I've worked on a script to toogle opening and closing layeSets, I've taken the code that TeddyBear posted here: http://ps-scripts.com/bb/viewtopic.php?p=14773 and adjusted it a little bit, and that's what I came up with, I hope it will help you:
    <javascriptresource>
      <name>BCM> ToogleOpen_CloseGroup...</name>
      <category>BCM</category>
    </javascriptresource>
    //For code readability
    // http://ps-scripts.com/bb/viewtopic.php?f=9&t=3235
    function getActiveLayerIndex() {
        var ref = new ActionReference();
        ref.putProperty( charIDToTypeID("Prpr") , charIDToTypeID( "ItmI" ));
        ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
        return executeActionGet(ref).getInteger(charIDToTypeID( "ItmI" ));
    function cTID(s){return charIDToTypeID(s)}
    function sTID(s){return stringIDToTypeID(s)}
    // =============================
    // The main function
    function closeGroup(layerSet) {
       var m_Name = layerSet.name;
       var m_Opacity = layerSet.opacity;
       var m_BlendMode = layerSet.blendMode;
       var m_LinkedLayers = layerSet.linkedLayers;
      var currINDEX = getActiveLayerIndex();
       var m_bHasMask = hasLayerMask();
       if(m_bHasMask) loadSelectionOfMask();
       if(layerSet.layers.length <= 1) {
          addTempLayerSetIn(currSetIDX-1);
          makeActiveByIndex(currSetIDX+2, false);
          ungroup();
          groupSelected(m_Name);
          deleteTempLayerSetbyIdx(currSetIDX+1);
       } else {
           makeActiveByIndex(currSetIDX, false);
          ungroup();
          groupSelected(m_Name);
       var m_Closed = activeDocument.activeLayer;
       m_Closed.opacity = m_Opacity;
       m_Closed.blendMode = m_BlendMode;
       for(x in m_LinkedLayers) {
          if(m_LinkedLayers[x].typename == "LayerSet")
             activeDocument.activeLayer.link(m_LinkedLayers[x]);
       if(m_bHasMask) maskFromSelection();
       return m_Closed;
    // =============================
    // Below are all necessary subroutines for the main function to work
    function ungroup() {
       var m_Dsc01 = new ActionDescriptor();
       var m_Ref01 = new ActionReference();
       m_Ref01.putEnumerated( cTID( "Lyr " ), cTID( "Ordn" ), cTID( "Trgt" ) );
       m_Dsc01.putReference( cTID( "null" ), m_Ref01 );
       try {
          executeAction( sTID( "ungroupLayersEvent" ), m_Dsc01, DialogModes.NO );
       } catch(e) {}
    function addLayer() {
       var m_ActiveLayer          =    activeDocument.activeLayer;
       var m_NewLayer             =    activeDocument.layerSets.add();
       m_NewLayer.move(m_ActiveLayer, ElementPlacement.PLACEBEFORE);
       return m_NewLayer;
    function hasLayerMask() {
       var m_Ref01 = new ActionReference();
       m_Ref01.putEnumerated( sTID( "layer" ), cTID( "Ordn" ), cTID( "Trgt" ));
       var m_Dsc01= executeActionGet( m_Ref01 );
       return m_Dsc01.hasKey(cTID('Usrs'));
    function activateLayerMask() {
       var m_Dsc01 = new ActionDescriptor();
       var m_Ref01 = new ActionReference();
       m_Ref01.putEnumerated( cTID( "Chnl" ), cTID( "Chnl" ), cTID( "Msk " ) );
       m_Dsc01.putReference( cTID( "null" ), m_Ref01 );
       try {
          executeAction( cTID( "slct" ), m_Dsc01, DialogModes.NO );
       } catch(e) {
          var m_TmpAlpha = new TemporaryAlpha();
          maskFromSelection();
          activateLayerMask();
          m_TmpAlpha.consume();
    function deleteMask(makeSelection) {
       if(makeSelection) {
          loadSelectionOfMask();
       var m_Dsc01 = new ActionDescriptor();
       var m_Ref01 = new ActionReference();
       m_Ref01.putEnumerated( cTID( "Chnl" ), cTID( "Ordn" ), cTID( "Trgt" ) );
       m_Dsc01.putReference( cTID( "null" ), m_Ref01 );
       try {
          executeAction( cTID( "Dlt " ), m_Dsc01, DialogModes.NO );
       } catch(e) {}
    function selectLayerMask() {
       var m_Dsc01 = new ActionDescriptor();
       var m_Ref01 = new ActionReference();
       m_Ref01.putEnumerated(cTID("Chnl"), cTID("Chnl"), cTID("Msk "));
       m_Dsc01.putReference(cTID("null"), m_Ref01);
       m_Dsc01.putBoolean(cTID("MkVs"), false );
       try {
          executeAction(cTID("slct"), m_Dsc01, DialogModes.NO );
       } catch(e) {}
    function loadSelectionOfMask() {
       selectLayerMask();
       var m_Dsc01 = new ActionDescriptor();
       var m_Ref01 = new ActionReference();
       m_Ref01.putProperty( cTID( "Chnl" ), cTID( "fsel" ) );
       m_Dsc01.putReference( cTID( "null" ), m_Ref01 );
       var m_Ref02 = new ActionReference();
       m_Ref02.putEnumerated( cTID( "Chnl" ), cTID( "Ordn" ), cTID( "Trgt" ) );
       m_Dsc01.putReference( cTID( "T   " ), m_Ref02 );
       try {
          executeAction( cTID( "setd" ), m_Dsc01, DialogModes.NO );
       } catch(e) {}
    function maskFromSelection() {
       if(!hasLayerMask()) {
          var m_Dsc01 = new ActionDescriptor();
          m_Dsc01.putClass( cTID( "Nw  " ), cTID( "Chnl" ) );
          var m_Ref01 = new ActionReference();
          m_Ref01.putEnumerated( cTID( "Chnl" ), cTID( "Chnl" ), cTID( "Msk " ) );
          m_Dsc01.putReference( cTID( "At  " ), m_Ref01 );
          m_Dsc01.putEnumerated( cTID( "Usng" ), cTID( "UsrM" ), cTID( "RvlS" ) );
          try {
             executeAction( cTID( "Mk  " ), m_Dsc01, DialogModes.NO );
          } catch(e) {
             activeDocument.selection.selectAll();
             maskFromSelection();
       } else {
          if(confirm("Delete existing mask?", true, "Warning")) {
             activateLayerMask();
             deleteMask();
    function groupSelected(name) {
       var m_Dsc01 = new ActionDescriptor();
       var m_Ref01 = new ActionReference();
       m_Ref01.putClass( sTID( "layerSection" ) );
       m_Dsc01.putReference(  cTID( "null" ), m_Ref01 );
       var m_Ref02 = new ActionReference();
       m_Ref02.putEnumerated( cTID( "Lyr " ), cTID( "Ordn" ), cTID( "Trgt" ) );
       m_Dsc01.putReference( cTID( "From" ), m_Ref02 );
       var m_Dsc02 = new ActionDescriptor();
       m_Dsc02.putString( cTID( "Nm  " ), name);
       m_Dsc01.putObject( cTID( "Usng" ), sTID( "layerSection" ), m_Dsc02 );
       executeAction( cTID( "Mk  " ), m_Dsc01, DialogModes.NO );
       return activeDocument.activeLayer;
    function addToSelection(layerName) {
       var m_Dsc01 = new ActionDescriptor();
       var m_Ref01 = new ActionReference();
       m_Ref01.putName( cTID( "Lyr " ), layerName );
       m_Dsc01.putReference( cTID( "null" ), m_Ref01 );
       m_Dsc01.putEnumerated( sTID( "selectionModifier" ), sTID( "selectionModifierType" ), sTID( "addToSelection" ) );
       m_Dsc01.putBoolean( cTID( "MkVs" ), false );
       try {
          executeAction( cTID( "slct" ), m_Dsc01, DialogModes.NO );
       } catch(e) {}
    function TemporaryAlpha() {
       activeDocument.selection.store((this.alpha = activeDocument.channels.add()));
       activeDocument.selection.deselect();
       this.consume = function() {
          activeDocument.selection.load(this.alpha);
          this.alpha.remove();
    function makeActiveByIndex( idx, visible ){
         if( idx.constructor != Array ) idx = [ idx ];
         for( var i = 0; i < idx.length; i++ ){
              var desc = new ActionDescriptor();
              var ref = new ActionReference();
              ref.putIndex(charIDToTypeID( 'Lyr ' ), idx[i])
              desc.putReference( charIDToTypeID( 'null' ), ref );
              if( i > 0 ) {
                   var idselectionModifier = stringIDToTypeID( 'selectionModifier' );
                   var idselectionModifierType = stringIDToTypeID( 'selectionModifierType' );
                   var idaddToSelection = stringIDToTypeID( 'addToSelection' );
                   desc.putEnumerated( idselectionModifier, idselectionModifierType, idaddToSelection );
              desc.putBoolean( charIDToTypeID( 'MkVs' ), visible );
              executeAction( charIDToTypeID( 'slct' ), desc, DialogModes.NO );
    function deleteActiveLayer(){
       // =======================================================
       var idDlt = charIDToTypeID( "Dlt " );
           var desc752 = new ActionDescriptor();
           var idnull = charIDToTypeID( "null" );
               var ref529 = new ActionReference();
               var idLyr = charIDToTypeID( "Lyr " );
               var idOrdn = charIDToTypeID( "Ordn" );
               var idTrgt = charIDToTypeID( "Trgt" );
               ref529.putEnumerated( idLyr, idOrdn, idTrgt );
           desc752.putReference( idnull, ref529 );
       executeAction( idDlt, desc752, DialogModes.NO );
    function isLayerSet( idx ) {
         var propName = stringIDToTypeID( 'layerSection' );
         var ref = new ActionReference();
         ref.putProperty( charIDToTypeID( "Prpr" ) , propName);
         ref.putIndex( charIDToTypeID ( "Lyr " ), idx );
         var desc =  executeActionGet( ref );
         var type = desc.getEnumerationValue( propName );
         var res = typeIDToStringID( type );
         // alert(res);
         return res == 'layerSectionStart' ? true:false;
    function openGroup1(theGroup) {
       currSetIDX= getActiveLayerIndex();
       if(isLayerSet( currSetIDX ))
        getNamesPlusIDsOfLayerSet();
      makeActiveByIndex(currSetIDX, false);
    function getNamesPlusIDsOfLayerSet(){
       var ref = new ActionReference();
       ref.putEnumerated( charIDToTypeID('Lyr '), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
       var count = executeActionGet(ref).getInteger(charIDToTypeID('Cnt '));
      var parId = executeActionGet(ref).getInteger(stringIDToTypeID( 'layerID' ));
       var Names=[];
       var x = 0;
       var y = 0;
       var r = 0;
       currINDEX = getActiveLayerIndex();
        var i = currINDEX;
       for(i; i > 0 ; i--){
            ref = new ActionReference();
            ref.putIndex( charIDToTypeID( 'Lyr ' ), i );
            var desc = executeActionGet(ref);
            var layerName = desc.getString(charIDToTypeID( 'Nm  ' ));
            var Id = desc.getInteger(stringIDToTypeID( 'layerID' ));
            var ls = desc.getEnumerationValue(stringIDToTypeID("layerSection"));
            ls = typeIDToStringID(ls);
            // alert(layerName+": _ :"+ls);
            if(ls == "layerSectionStart"){x++};
            if(layerName.match(/^<\/Layer group/) )
              y ++;
              r = x - y;
              if(r == 0 && ls == "layerSectionEnd"){break};
              continue
            if(ls == "layerSectionContent"){makeActiveByIndex(i,false);break};
            var layerType = typeIDToStringID(desc.getEnumerationValue( stringIDToTypeID( 'layerSection' )));
            var isLayerSet =( layerType == 'layerSectionContent') ? false:true;
    Names.push([[Id],[layerName],[isLayerSet]]);
    return Names;
    function getLayersNb()//function to find out if the number of layers in the document
        var ref = new ActionReference();
        ref.putProperty( charIDToTypeID( 'Prpr' ), stringIDToTypeID('numberOfLayers') );
        ref.putEnumerated( charIDToTypeID( "Dcmn" ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ) );
        var desc = executeActionGet(ref);
        var numberOfLayers = desc.getInteger(stringIDToTypeID('numberOfLayers'));
        return numberOfLayers;
    function toogleOpenCloseSet(){
      myALayerIDX = getActiveLayerIndex();
      myGroupP = app.activeDocument.activeLayer;
      if(!isLayerSet(myALayerIDX)){
          myGroupP = app.activeDocument.activeLayer.parent;
          if(myGroupP.typename != "Document"){
            if(isSetOpened1(myGroupP)){closeGroup(myGroupP)}else{openGroup1(myGroupP)};
      }else{
        if(isSetOpened1(myGroupP)){closeGroup(myGroupP)}else{openGroup1(myGroupP)};
    function getFristLayerSetChildVisible(){
      xx = false;
       var ref = new ActionReference();
       ref.putEnumerated( charIDToTypeID('Lyr '), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
       var count = executeActionGet(ref).getInteger(charIDToTypeID('Cnt '));
      var parId = executeActionGet(ref).getInteger(stringIDToTypeID( 'layerID' ));
       var Names=[];
        var x = 0;
        var y = 0;
        var r = 0;
       currINDEX = getActiveLayerIndex();
        var i = currINDEX;
       for(i; i > 0 ; i--){
            ref = new ActionReference();
            ref.putIndex( charIDToTypeID( 'Lyr ' ), i );
            var desc = executeActionGet(ref);
            var layerName = desc.getString(charIDToTypeID( 'Nm  ' ));
            var Id = desc.getInteger(stringIDToTypeID( 'layerID' ));
            var ls = desc.getEnumerationValue(stringIDToTypeID("layerSection"));
            ls = typeIDToStringID(ls);
            var vis = desc.getInteger(stringIDToTypeID( 'visible' ));
            // alert(layerName+": _ :"+vis);
    /*        if(desc.hasKey(stringIDToTypeID("visible")))
              alert(desc.getType(stringIDToTypeID("visible")));
            if(ls == "layerSectionStart"){x++};
            if(vis == 1 && Id!=parId && r!=0){
              var theOBj = {id:Id, lname:layerName, idx:i};
              xx =true;
              Names.push(theOBj);
              break;
            if(layerName.match(/^<\/Layer group/) )
              y ++;
              r = x - y;
              if(r == 0 && ls == "layerSectionEnd"){break};
              continue
        return Names;
    function getLastChildIdx(){
      xx = false;
       var ref = new ActionReference();
       ref.putEnumerated( charIDToTypeID('Lyr '), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
       var count = executeActionGet(ref).getInteger(charIDToTypeID('Cnt '));
      var parId = executeActionGet(ref).getInteger(stringIDToTypeID( 'layerID' ));
       currINDEX = getActiveLayerIndex();
        var i = currINDEX;
        var x = 0;
        var y = 0;
        var r = 0;
        var lastChIdx = 0;
       for(i; i > 0 ; i--){
            ref = new ActionReference();
            ref.putIndex( charIDToTypeID( 'Lyr ' ), i );
            var desc = executeActionGet(ref);
            var layerName = desc.getString(charIDToTypeID( 'Nm  ' ));
            var Id = desc.getInteger(stringIDToTypeID( 'layerID' ));
            var ls = desc.getEnumerationValue(stringIDToTypeID("layerSection"));
            ls = typeIDToStringID(ls);
            var vis = desc.getInteger(stringIDToTypeID( 'visible' ));
            if(ls == "layerSectionStart"){x++};
            if(layerName.match(/^<\/Layer group/) )
              y ++;
              r = x - y;
              if(r == 0 && ls == "layerSectionEnd")
                lastChIdx = i;
                break;
            // alert(x+" _ "+y+" _ "+r+" _ "+layerName);
        return lastChIdx;
    function getNbOfChilds(){
      xx = false;
       var ref = new ActionReference();
       ref.putEnumerated( charIDToTypeID('Lyr '), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
       var count = executeActionGet(ref).getInteger(charIDToTypeID('Cnt '));
      var parId = executeActionGet(ref).getInteger(stringIDToTypeID( 'layerID' ));
       currINDEX = getActiveLayerIndex();
        var i = currINDEX;
        var nb = 0;
        var x = 0;
        var y = 0;
        var r = 0;
       for(i; i > 0 ; i--){
            ref = new ActionReference();
            ref.putIndex( charIDToTypeID( 'Lyr ' ), i );
            var desc = executeActionGet(ref);
            var layerName = desc.getString(charIDToTypeID( 'Nm  ' ));
            var Id = desc.getInteger(stringIDToTypeID( 'layerID' ));
            var ls = desc.getEnumerationValue(stringIDToTypeID("layerSection"));
            ls = typeIDToStringID(ls);
            var vis = desc.getInteger(stringIDToTypeID( 'visible' ));
            if(ls == "layerSectionStart"){x++};
            if(layerName.match(/^<\/Layer group/) )
              y ++;
              r = x - y;
              if(r == 0 && ls == "layerSectionEnd")
                break
              continue
            nb++;
        return nb;
    function isSetOpened1( group ){
      app.activeDocument.activeLayer = group;
      xx = true;
      currSetIDX = getActiveLayerIndex();
      addTempLayerSetIn(currSetIDX-1);
      var fIdx = getActiveLayerIndex();
      makeActiveByIndex(currSetIDX+2, false);
      if(fIdx == getActiveLayerIndex())
        xx = false;
      deleteTempLayerSetbyIdx(currSetIDX+1);
      return xx;
    function addTempLayerSetIn(idxx){
        // =======================================================
        var idMk = charIDToTypeID( "Mk  " );
            var desc58 = new ActionDescriptor();
            var idnull = charIDToTypeID( "null" );
                var ref63 = new ActionReference();
                var idlayerSection = stringIDToTypeID( "layerSection" );
                ref63.putClass( idlayerSection );
            desc58.putReference( idnull, ref63 );
        executeAction( idMk, desc58, DialogModes.NO );
        // =======================================================rename
        var idsetd = charIDToTypeID( "setd" );
            var desc202 = new ActionDescriptor();
            var idnull = charIDToTypeID( "null" );
                var ref209 = new ActionReference();
                var idLyr = charIDToTypeID( "Lyr " );
                var idOrdn = charIDToTypeID( "Ordn" );
                var idTrgt = charIDToTypeID( "Trgt" );
                ref209.putEnumerated( idLyr, idOrdn, idTrgt );
            desc202.putReference( idnull, ref209 );
            var idT = charIDToTypeID( "T   " );
                var desc203 = new ActionDescriptor();
                var idNm = charIDToTypeID( "Nm  " );
                desc203.putString( idNm, "mb-dummy tempTestLayerSetOpen_Closed" );
            var idLyr = charIDToTypeID( "Lyr " );
            desc202.putObject( idT, idLyr, desc203 );
        executeAction( idsetd, desc202, DialogModes.NO );
        // =======================================================move
        var idmove = charIDToTypeID( "move" );
            var desc59 = new ActionDescriptor();
            var idnull = charIDToTypeID( "null" );
                var ref64 = new ActionReference();
                var idLyr = charIDToTypeID( "Lyr " );
                var idOrdn = charIDToTypeID( "Ordn" );
                var idTrgt = charIDToTypeID( "Trgt" );
                ref64.putEnumerated( idLyr, idOrdn, idTrgt );
            desc59.putReference( idnull, ref64 );
            var idT = charIDToTypeID( "T   " );
                var ref65 = new ActionReference();
                var idLyr = charIDToTypeID( "Lyr " );
                ref65.putIndex( idLyr, idxx );
            desc59.putReference( idT, ref65 );
            var idAdjs = charIDToTypeID( "Adjs" );
            desc59.putBoolean( idAdjs, false );
            var idVrsn = charIDToTypeID( "Vrsn" );
            desc59.putInteger( idVrsn, 5 );
        executeAction( idmove, desc59, DialogModes.NO );
    function deleteTempLayerSetbyIdx(idxx){
      // =======================================================
      var idDlt = charIDToTypeID( "Dlt " );
          var desc = new ActionDescriptor();
              var ref = new ActionReference();
              ref.putIndex(charIDToTypeID( 'Lyr ' ), idxx);
              // ref.putIdentifier(charIDToTypeID( 'Lyr ' ), idxx);
              desc.putReference( charIDToTypeID( 'null' ), ref );
      executeAction( idDlt, desc, DialogModes.NO );
    toogleOpenCloseSet();

  • Control of layer sets in EDA objects

    We are using AutoVue in a process to review design library objects, as they are being created. We have a large number (10,000+) of these items to review and would like to make the user experience as simple as possible. One of the more cumbersome pieces of the review process is changing the visibility of layers. All of these objects have a common set of layers (same names and order). We are trying to determine if there is a way to simplify the layer visibility process. Here are a couple of thoughts we have and are looking for suggestions/alternatives.
    Option 1
    We know that a number of layer sets could be created where each set controls the visibility of a select set of layers. The layers sets could then be stored in a markup file. We know that the markup.map file controls the relationship between the object being viewed and the mark file. We could alter/programmatically update this file to have each of the objects point to the same markup file. This seems to be kind of a kludge and has a number of holes that make it not very desirable.
    Option 2
    We know that the UI can be altered depending on the user. We are thinking that if we could create menu items or icons that set the visibility for the various views the users need, it would make the process much more elegant and less time consuming. Several questions come to mind in this option. Can the UI be modified to add additional menu selection or icons? Can a menu item or icon be used to set the layer visibility? Can the method by which AutoVue is launched be used to control the ultimate appearance and options available to the user? If we were to pursue this option, is there a recipe already in place that could guide us through the process?
    Any and all responses are greatly appreciated.

    Hi Charlie,
    Thanks for clarifying that each of your EDA files have the same set of layers with the same names in the same order - this is a crucial factor if you want to try to approach this in a programmatic or batch manner.
    As we discussed earlier today in a separate thread, Option #1 (creating a single markup file with the saved views and linking that markup to multiple base files) might lead to problems. As you know, when AutoVue is not integrated to a DMS/PLM, the markups are managed on the AutoVue server in the markups.map file... and while that file is ASCII and could be modified (not recommended), remember that the mapping depends on exactly where the base file was opened from and what protocol was used to open that file. As a result, if the same file might be opened in 2 different ways (e.g. one time locally from the user's machine, and one time from a web URL), the markup won't automatically be linked to both. Option #1 might be too unpredictable.
    Therefore I'd recommend Option #2. I'll ask the experts to chime in if they disagree, but I think that what you'd like to achieve is possible through the AutoVue API and can be broken down into 3 parts:
    1. Writing the core code to enable/disable specific layers
    2. Packaging this code as a custom "VueAction" so that it can be called as a custom menu or toolbar item
    3. Customizing the GUI to expose this menu or toolbar item
    Part 1 (code to enable/disable specific layers) should be relatively easy. The AutoVue API includes a class called "com.cimmetry.core.PAN_LAYER" which represents a layer in a file (including EDA files). With the API you can:
    - Get the list of layers from the current file (VueBean.getLayersState)
    - Enable/disable the layers as required (PAN_LAYER.setState(PAN_LAYER.STATE_ON) or PAN_LAYER.setState(PAN_LAYER.STATE_OFF))
    - Re-apply the updated layer set (VueBean.setLayersState)
    Part 2 (building a custom VueAction) is a bit more complex, but is explained quite well in the new API Programmer's Guide (http://download.oracle.com/docs/cd/E22156_02/otn/pdf/E22092_01.pdf) that shipped with AutoVue 20.1.0. I'd recommend to read pages 20-22 and 30-35. You would want to take the code from Part 1 and package it into your custom VueAction's "perform" method.
    Part 3 (customizing the GUI) should also be relatively easy, and is discussed on pages 62-68 of the Installation and Configuration Guide (http://download.oracle.com/docs/cd/E22156_02/otn/pdf/E22093_01.pdf).
    But rather than just saying "read the docs", we also now provide a pre-written example of a custom VueAction with AutoVue 20.1.0 Client/Server Deployment (I think it's an optional component during install). If you've included it during the install, you'll have the folder \examples\VueActionSample in your server installation. You should be able to use that as a reference for adding your own custom VueAction to the applet.
    There's one other part I hadn't included. In our separate thread earlier today, I think you mentioned you wanted to only provide this GUI customization for certain users. If you want to control the GUI based on user/group/role/etc, this is possible but will be up to you to determine the user/group/role/etc and script the JVue applet accordingly (i.e. either dynamically script the applet to set the GUIFILE parameter, or use the JVue.setGUI method).
    Hope this helps as a start.
    Thanks,
    Graham
    EDIT: If you prefer to automate the layer config as soon as the file is loaded - rather than have it as a custom menu or toolbar item - you can do that as well and in fact it's much easier. In that case you still go through Part 1 and write the code to set the desired layers, and you implement it as a 2nd applet as described in Oracle KM Note 754612.1 (https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&doctype=HOWTO&id=754612.1).
    Edited by: user638792 on Apr 5, 2011 8:23 PM

  • PSE 8 and Layer sets

    I am working with Photoshop CS and Photoshop Elements 8. Does Photoshop Elements 8 support "Layer Sets" or does it force you to "flatten" the set like earlier version of PSE.

    It does not support Group layers. It will ask you to merger layers as it did in previous versions.

  • Since Last CC Update Photoshop has lost the ability to CTRL click on layer within group??

    Weird little glitch is happening since the latest update of CC. Can anyone else confirm that they are having this issue:
    1. Create a group with a bunch of different layers
    2. Select any tool (besides the direct selection tool)
    3. Now press CTRL to try and select a layer and move it within the group.
    You will notice that it moves the whole group and not just the selected layer...it does not select the layer. My Direct Selection Tool is set to "Layer" not "group"....so that is not the issue here.
    This is annoying...does adobe know about this?

    Okay, found the fix.
    With the Move tool selected, go to the Options toolbar at the top (below file menu) and change the drop down menu to Layer instead of Group. Voila!

  • How to set group contacts in nokia asha 305

    how to  set group contacts  in nokia asha 305....thank u......

    Can Some one Tell same group contact creation for ASHA 308 too?

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

  • Photosho CS Problem - Can't drag a layer set from one document to another one

    I have two documents open
    On the source document, i want to drag a layer set from this document to a new one, but its not letting me
    What would cause this.
    My structure for the source document is
    >Set 1 Layer Set
         >layer
         > Adjustment Layer
         >background
    Background
    Structure of the target document
    >Named Layer Set
         > Where I want to insert the Layer Set from source document
         >layer
         > Adjustment Layer
         >background
    Background

    No error message is given. I just can't drag it into the spot I want to drag the layer set to (its not an individual layer, its a layer set)
    Basically, this is all I can do (have to do a correction on how the layers and layer sets work, missing one level from the original post):
    I've attached images as well to illustrate
    On my target document, I want to have the layer set go where the red text is:
    >Content Layer Set
         >Named Layer Set
              > Where I want to insert the Layer Set from source document (Set 1)
              >layer
              > Adjustment Layer
              >background
    Background
    right now, I can only drag the layer set to this position:
    >Content Layer Set
          > This is where the Set 1 from the source document can go, I can't drag it into the layer set below
         >Named Layer Set
              >layer
              > Adjustment Layer
              >background
    Background
    First Image I attached shows the Set 1 Layer Set, above the layer set I want to drag it into
    Second Image I attached shows what happens when I try to drag the layer set into the named layer set; it comes up with the "no symbol"
    No Error message is given

  • How to set group name as default value in People Picker in Infopath 2010

    How to set group name (shareoint Groupname)  as default value in People Picker in Infopath 2010

    Under the Developer tab in Infopath you can manage Loading Events, unfortunetly i dont have Visual Studio on this PC so i cant laborate, but i believe it's rather simple to figure out.
    Edit: Found a easier way, through Data > Default Values.

  • Can't rename Setting Group

    I create a new Setting Group which appears as an Untitled Folder in the Settings Dialogue. I have double clicked on the name, right clicked, Spaced, Returned... I can't figure out how to change the name of the folder.
    Any thoughts?
    Thanks!
    TAK

    You have a Costume folder (this folder can't be renamed) inside that folder you can have costume settings or folders with costume settings inside them. Click on the untitled folder, in the Inspector window change the name to the folder.

  • Unable to set group acl

    I am trying to import a 3.0.6 content area into a 3.0.6 portal
    schema. When I run contimp it imports the rows for the tables
    correctly. When it tries to merge I receive errors such as
    Unable to set group acl for: INTRANET/36/22025/FOLDER many times
    with the 22025 number changing. INTRANET is the name of the
    schema which I am importing the content area from.
    In the portal site the new content area name is present but
    there are no options for edit, properties etc and when I try to
    access the content area I receive Error 30502: The folder ID
    does not exist.
    Thanks for any help.

    Hi
    I took an export of my 3.0.6 content area using contexp. I then
    upgraded this portal schema to 3.0.9 which did not go
    correctly. The folders and content area is there but I cannot
    access the pages. I receive a 'Page not found' error. I am
    therefore trying to import the 3.0.6 export into another 3.0.6
    schema using contimp.
    Thanks for your help.

  • I suggest maintaining the "Layer" and "Group" concept as in Photoshop

    Another one I see many people asking about is the ability to "Name" the boxes. Box. Box, Box, Box, is not too intuitive.
    I am also going to suggest maintaining the "Layer" and "Group" concept as in Photoshop to soften the learning curve for new users.
    I currently have boxes that are NOT grouped, but behaving like a group if I try to move them. Kinda frustrating.

    You can double click on a Div in the DOM panel to rename any 'layer' or 'group'
    You can also degroup and regroup grouped elements by clicking on the little grouped icon which might be why your group isn't behaving like a group.

  • Independent layer sets for each artboard

    Currently the layer structure is the same over all artboards in a document. I would like to  start a new artboard with layers independent of the existing ones. A layer set will depend on the kind of artwork you create on a particular artboard, and is meaningless when you start a new artboard. So I would suggest to start each artboard with its single default layer, and add new layers only for the artboard I'm currently working on.
    Extra credit for the option to copy a layer structure from one artboard to another, though I'm not sure I'd use that much.

    Great idea/suggestion. It seems so logical and straightforward I am bewildered that this feature is not yet included in Illustrator.

  • Is it possible to set GRoup Policy to prevent users manually changing Power Options?

    Hello,
    We use Dell laptops and there is a very well known issue that certain models freeze when they are docked.
    I have adjusted the power settings under high performance plan, and updated this in the group policy, which I have tested and is all fine.
    Basically, on the laptops now, the users can still change it from the GPO plan to balanced or power saver if they want to.
    Is there a way of setting group policy so the other power options are greyed out or cannot be used?
    Thanks!

    Hi!
    If the user is a local administrator on the client they will be able to change the plans. (They changes will be reverted when logging off though)
    But if they are standard users, it should be grayed out already.
    Check this link for more information, if there is a step that you might have missed when configuring the GPO. (Three pages/Parts)
    http://blogs.technet.com/b/askds/archive/2008/03/21/managing-power-with-group-policy-part-3-of-3.aspx
    Best regards
    Andreas Molin
    Andreas Molin | Site: www.guidestomicrosoft.com | Twitter: andreas_molin

Maybe you are looking for

  • Unactivated and no passcode. Can I bring the phone in to get it factory reset?

    I've tried resetting it from iTunes and only code an error code, so I tried updating iTunes and it won't show up at all now. I bought the iPhone from someone on Craigslist, He said the ESN is good but I had to get the LCD screen as well as the glass

  • Update FI item text from PO item text

    Hi all,                  i am trying to update FI item text(bseg) from PO item text(ekpo).I know that bseg is a culster table therefore inner join is not allow.So is there a way i can join these two tables together so i can retrieve the line item and

  • My provisioning profile is about to expire what do i do

    i got on my 4th generation ipod touch one day and it said my provisioning profile is about to expire and i had never heard of that b4 so i websearched it and it said that some apps install it and dont work anymore when they expire so what i want to k

  • How to prepare sales order quantiti with free quantity reprot?

    Hi SAP Guru's,                         I need to create a reprot that is based on special schemes like bye 2 get 1 free in that report client wants order quantity along with free quantity. please help me to generate a report. Hussain.

  • Download originate file from DMS content server

    Hi, I want to copy a originate file which is attached with a document and save it in one particular location in my pc.