2 Replies Latest reply on Mar 19, 2015 3:05 AM by Philip Cord

    les scripts photoshop

    sébastieng89944108

      Bonjour,

      Que veut dire la commande (dans un script) : selection calque 1 sur calque 2 (sans rendre visible) ?

      Merci

        • 1. Re: les scripts photoshop
          c.pfaffenbichler Level 9

          Please elaborate, maybe posting some screenshots could help.

          • 2. Re: les scripts photoshop
            Philip Cord Level 4

            This should select the next layer when it is not visible.

             

            nextLayer(0); // up
            //nextLayer(1); // down
            
            function nextLayer(direction){
            var ref = new ActionReference();
            ref.putEnumerated( charIDToTypeID('Lyr '),charIDToTypeID('Ordn'),charIDToTypeID('Trgt') );
            try{ 
            activeDocument.backgroundLayer; 
            index = executeActionGet(ref).getInteger(charIDToTypeID( "ItmI" ))-1; 
            }catch(e){ 
            index = executeActionGet(ref).getInteger(charIDToTypeID( "ItmI" )); 
            }
            ref = new ActionReference();
            if(direction == 0){
            ref.putIndex(charIDToTypeID("Lyr "), index  + 1);
            }else{
                ref.putIndex(charIDToTypeID("Lyr "), index  -1);
                }
            var desc = new ActionDescriptor();
            desc.putReference(charIDToTypeID("null"), ref ); 
            desc.putBoolean( charIDToTypeID( "MkVs" ), false ); 
            try{
            executeAction(charIDToTypeID("slct"), desc, DialogModes.NO );
            }catch(e){}
            };