3 Replies Latest reply on Aug 22, 2013 11:37 AM by Jeffrey Tranberry

    Keyboard shortcuts

    jarmovalmari

      I'd like to assign keyboard shortcuts

       

      Layer panel window

       

      cmd-l : lock selected layer or group

      cmd-alt-l: unlock selected layer or group

       

      cmd-alt-c: copy layer style

      cmd-alt-v: paste layer style

       

       

      Copy layer style is listed in the keyboard shortcuts dialog. For some reason it wants to raster shape layers so that's totally unusable. Help would be very much appreciated!

        • 1. Re: Keyboard shortcuts
          Jeffrey Tranberry Adobe Employee

          Here's script code you can use for locking/unlocking. Copy and paste the code in the text document and save the files as lock.jsx and unlock.jsx.

           

          Then put them in the Presets>Scripts folder in the Photoshop application folder. Restart Photoshop. Then assign your KB shortcut.

           

          Lock Layer:

           

          var idsetd = charIDToTypeID( "setd" );

              var desc20 = new ActionDescriptor();

              var idnull = charIDToTypeID( "null" );

                  var ref15 = new ActionReference();

                  var idLyr = charIDToTypeID( "Lyr " );

                  var idOrdn = charIDToTypeID( "Ordn" );

                  var idTrgt = charIDToTypeID( "Trgt" );

                  ref15.putEnumerated( idLyr, idOrdn, idTrgt );

              desc20.putReference( idnull, ref15 );

              var idT = charIDToTypeID( "T   " );

                  var desc21 = new ActionDescriptor();

                  var idlayerLocking = stringIDToTypeID( "layerLocking" );

                      var desc22 = new ActionDescriptor();

                      var idprotectAll = stringIDToTypeID( "protectAll" );

                      desc22.putBoolean( idprotectAll, true );

                  var idlayerLocking = stringIDToTypeID( "layerLocking" );

                  desc21.putObject( idlayerLocking, idlayerLocking, desc22 );

              var idLyr = charIDToTypeID( "Lyr " );

              desc20.putObject( idT, idLyr, desc21 );

          executeAction( idsetd, desc20, DialogModes.NO );

           

          UnLock Layer:

           

          var idsetd = charIDToTypeID( "setd" );

              var desc23 = new ActionDescriptor();

              var idnull = charIDToTypeID( "null" );

                  var ref16 = new ActionReference();

                  var idLyr = charIDToTypeID( "Lyr " );

                  var idOrdn = charIDToTypeID( "Ordn" );

                  var idTrgt = charIDToTypeID( "Trgt" );

                  ref16.putEnumerated( idLyr, idOrdn, idTrgt );

              desc23.putReference( idnull, ref16 );

              var idT = charIDToTypeID( "T   " );

                  var desc24 = new ActionDescriptor();

                  var idlayerLocking = stringIDToTypeID( "layerLocking" );

                      var desc25 = new ActionDescriptor();

                      var idprotectNone = stringIDToTypeID( "protectNone" );

                      desc25.putBoolean( idprotectNone, true );

                  var idlayerLocking = stringIDToTypeID( "layerLocking" );

                  desc24.putObject( idlayerLocking, idlayerLocking, desc25 );

              var idLyr = charIDToTypeID( "Lyr " );

              desc23.putObject( idT, idLyr, desc24 );

          executeAction( idsetd, desc23, DialogModes.NO );

          • 2. Re: Keyboard shortcuts
            Jeffrey Tranberry Adobe Employee

            I'll need to figure out the code for the layer style part. Let me know if you get the locking stuff working first.

            1 person found this helpful
            • 3. Re: Keyboard shortcuts
              Jeffrey Tranberry Adobe Employee

              Copy Layer Style:

               

              var idCpFX = charIDToTypeID( "CpFX" );

              executeAction( idCpFX, undefined, DialogModes.NO );

               

               

              Paste layer Style:

               

              var idPaFX = charIDToTypeID( "PaFX" );

                  var desc49 = new ActionDescriptor();

                  var idallowPasteFXOnLayerSet = stringIDToTypeID( "allowPasteFXOnLayerSet" );

                  desc49.putBoolean( idallowPasteFXOnLayerSet, true );

              executeAction( idPaFX, desc49, DialogModes.NO );

              1 person found this helpful