5 Replies Latest reply on Jul 10, 2017 5:34 AM by saad ghadir

    Renaming layers during actions...

    saad ghadir

      So i have an action where in the middle of it, i want to rename a layer. Inserting a menu item doesn't allow me to choose Layer>Rename layer... And when I rename a layer while the action is recording by double clicking on it, the action records "Set Current Layer...". you can click on the dialog box icon beside "Set current layer" but that doesn't actually show a dialogue box to allow you to rename a layer. Can anyone help me please. I just want to rename layers in the middle of actions. I will be happy to provide screenshots and other information if necessary.

        • 1. Re: Renaming layers during actions...
          Chuck Uebele Adobe Community Professional & MVP

          save the below code as a text file with the extension .jsx. Put it in the Presets\Scripts folder of Photoshop. Add a step in your action, after the layer is selected, to play the script from the File>Scripts menu.


          #target photoshop
          var doc = activeDocument;
          var pmt = prompt ('Type a new layer name', doc.activeLayer.name, 'Rename Layer');
          doc.activeLayer.name = pmt;
          2 people found this helpful
          • 2. Re: Renaming layers during actions...
            Stephen_A_Marsh Adobe Community Professional

            Adobe must have “fixed things up”…


            In CC 2017, the option to insert a menu command to rename a layer is grayed out:





            While CS6 teased you with the ability to add this command into an insert, however once the OK button was pressed nothing was actually inserted into the action!



            1 person found this helpful
            • 3. Re: Renaming layers during actions...
              Stephen_A_Marsh Adobe Community Professional

              It is possible to do this only using actions without referencing a script, however it is a bit of a hack…


              With the required layer targeted/highlighted by the preceding action step, the following commands can be added:


              1) Insert menu command: Duplicate current layer

              2) Record the selection of backward layer: OPT/ALT + [

              3) Insert menu command: Delete current layer

              4) Record the selection of forward layer: OPT/ALT + ]





              When the action steps are run, the duplicate layer dialog will allow the user to rename the layer. Then the original layer will be targeted and deleted and then the newly named layer will be targeted. A stop message with continue could be added if this was considered confusing (duplicate to rename), the obvious benefit of doing this with an action is that it is self contained/portable and does not rely on a script being installed… while the obvious benefit of using a script is that it is clear what is going on in the GUI.



              1 person found this helpful
              • 4. Re: Renaming layers during actions...
                Aurica Crudu

                for what reason you want rename the layer?
                do you want rename it different at every execution? Such as FreqSep1, FreqSep2, for example?
                if you have problems to access right layer by name in the action perhaps you can avoid this situation?

                for example, if you want to do frequency separation, and you need in apply image select blurred layer - you should select the option  merged, without targeting specific layer, but opacity of your current layer should be 0 for the moment.
                Or you have some different reason for renaming?

                • 5. Re: Renaming layers during actions...
                  saad ghadir Level 1

                  No I just want to rename the layer every time. Thank you for your help thought.