6 Replies Latest reply on May 11, 2018 5:47 AM by Kukurykus

    How to merge multiple groups and keep them on their separate layers?

    jamesc16840069 Level 1

      Hi Guys

       

      I'm sure there is a really simple way to do this but I can't find the answer anywhere!

       

      When I create multiple groups on separate layers, there must be a quicker way then right clicking and individually merging each layer so they stay on their respective layers?

       

      A shortcut would save so much time!!

       

      Thanks

       

      Screen Shot 2018-03-07 at 12.25.06.png

        • 1. Re: How to merge multiple groups and keep them on their separate layers?
          macpawel Adobe Community Professional

          First select all groups and

          Just use CTRL+E or Cmd+E on mac shortcut - and thats all

          pawel

          • 2. Re: How to merge multiple groups and keep them on their separate layers?
            Raimundo Illanes Adobe Community Professional

            You can try also, to convert it to a smart object> Layer > Smart Object > Convert to Smart Object, or just try right click at the name and Convert to Smart Object. That way you will have an embed separated PSB file.

            • 3. Re: How to merge multiple groups and keep them on their separate layers?
              jamesc16840069 Level 1

              Almost there, but these commands only do one layer at a time, or if select all and then Cmd+E it merges all layers into one layer.

               

              Doesn't take long to Cmd+E individual layers, but would be quicker if I could do all layers at the same - prob not!

               

              Thanks anyway

              • 4. Re: How to merge multiple groups and keep them on their separate layers?
                Kukurykus Adobe Community Professional

                I can't help right now but move your topic to Photoshop Scripting  and ask of help r-bin that should be easy for him

                 

                function sTT(v) {return stringIDToTypeID(v)} $.level = 0
                function R() {return ref = new ActionReference()} arr = []
                
                function DoL(v) {R().putEnumerated(sTT(v), sTT('ordinal'), sTT('targetEnum'))}
                
                function bGrnd(v) {R().putIndex(sTT('layer'), v)}
                
                function SC(v) {
                     return typeIDToStringID((dsc = executeActionGet(ref))
                     .getEnumerationValue(sTT(lS = 'layerSection'))) == lS + v
                }
                
                function sNL() {
                     DoL('layer'); (dsc = new ActionDescriptor()).putReference(sTT('null'), ref)
                     executeAction(sTT('selectNoLayers'), dsc, DialogModes.NO)
                }
                
                function mLN(v) {
                     R().putIdentifier(sTT('layer'), v);
                     (dsc = new ActionDescriptor()).putReference(sTT('null'), ref)
                     dsc.putBoolean(sTT('makeVisible'), true)
                     executeAction(sTT('select'), dsc, DialogModes.NO)
                     executeAction(sTT('mergeLayersNew'), undefined, DialogModes.NO)
                }
                
                function prcs(v1, v2) {
                     bGrnd(idx = v1), lID = executeActionGet(ref).getInteger(sTT('layerID'))
                     if (SC('Start')) {
                          bGrnd(idx - 1); if (SC('Content')) v2 ? arr.push(lID) : (sNL(), mLN(lID))
                     }
                }
                
                try{
                     R().putIdentifier(sTT('layer'), 1)
                     bG = !(executeActionGet(ref))
                     .getBoolean(sTT('background'))
                }
                catch (err) {bG = 1}
                
                DoL('document'), tL = sTT('targetLayers')
                if ((dsc = executeActionGet(ref)).hasKey(tL)) {
                     for(lst = dsc.getList(tL), i = 0; i < lst.count;) {
                          prcs(lst.getReference(i++).getIndex() + bG, true)
                     }
                     sNL(); for(i = 0; i < arr.length; i++) mLN(arr[i])
                }
                else {
                     DoL('layer'), prcs(executeActionGet(ref)
                     .getInteger(sTT('itemIndex')) - !bG, false)
                }
                
                1 person found this helpful
                • 5. Re: How to merge multiple groups and keep them on their separate layers?
                  Niknab0417 Level 1

                  Was this ever resolved? I've run into a similar issue. I'm trying to create font using the Fontself plugin, and need to merge several groups while still keeping each character/glyph on its own layer. I'm asking here because I couldn't find this topic in Photoshop Scripting.

                  • 6. Re: How to merge multiple groups and keep them on their separate layers?
                    Kukurykus Adobe Community Professional

                    I updated my previous post. Regarding your question tell me what that Fontself plugin does and is that needed for the script you want or script can work separately, without / after that plugin. I don't understand what you mean by keeping each glyph / character on its own layer as the script I wrote for jamesc16840069 merges each group into new single layers. Explain what you exactly mean, should be group of layers merged into new layer while glyphs/characters (what are they exactly?) will be kept on separate text layers? Write step by step what you exactly want...