13 Replies Latest reply on Dec 10, 2015 11:55 PM by GlossyBlacky

    combine text layers but keep text editable?  OR  A way to export text as a paragraph in InDesign into Photoshop

    genericuser1million Level 1

      Hoping to achieve one of these goals, either option is equally fine:

       

      Option 1) find a way to merge text layers but keep the text editable in Photoshop.

       

      Option 2) find a way in InDesign to group and collapse text so that it lands on one layer or one text paragraph that could be selected together.  So that when I export to EPS and then PSD the text is not sliced up on various layers but is combined into one editable text layer.

       

      Why?  I'm saving out from InDesign and for whatever reason the text is fragmented across many objects/layers/ whatever you want to call it.  When using the export feature from InDesign these bits of text are then saved out as separate layers when you export to EPS.  Using Illustrator with the EPS files is no help either. 

       

      The best way I can describe it is like in these InDesign document there are web page slices being used and various bits of the text are landing on various slices which in turn befuddles the export function that is valiantly trying to maintain these 'slices' of text by fragmenting letters, words, or characters across many 'slices' into many layers.

       

      Here's what the document looks like when I go from InDesign> export> EPS>  then open in Illustrator and export to PSD.

       

      What I want is all of those individual text layers to be one text layer, still editable, in Photoshop. 

       

      helpersText2.jpg

        • 1. Re: combine text layers but keep text editable?  OR  A way to export text as a paragraph in InDesign into Photoshop
          GlossyBlacky Level 1

          So gehts:

          1. Die Photoshop-Datei als PDF speichern.

          2.  in Acrobat öffnen

          3. > Werkzeuge >Texterkennung OCR starten oder anderes OCR-fähiges Programm

          4. Text mir Cursor kopieren

          5. In Photoshop einfügen.

          6. Text editieren.

          Besser wäre ein Script oder eine OCR-Funktion, ein OCR-Plugin in Photoshop!

           

          That's how it's done:
          1. Save the Photoshop file as PDF.
          2. Open in Acrobat, or in another OCR - program
          3. Tools -  Start Optical Character Recognition OCR
          4. Copy text with cursor
          5. Insert text into Photoshop.

          6. Edit Text

          Better would be a script or an OCR function, or a OCR plugin in Photoshop!


          Wolfgang Kreische

          Photowerkstatt Dresden Peak-Prints

          http://www.photowerkstatt-dresden.de

          http://www.peak-prints.com


          • 2. Re: combine text layers but keep text editable?  OR  A way to export text as a paragraph in InDesign into Photoshop
            c.pfaffenbichler Level 8
            What I want is all of those individual text layers to be one text layer, still editable, in Photoshop.

            Why? What is the ultimate output?

            Would the text as a Smart Object be an option?


             

            I'm saving out from InDesign and for whatever reason the text is fragmented across many objects/layers/ whatever you want to call it.

             

            Is the text homogenous (font, size, kerning, …)?


            GlossyBlacky’s approach is an option, but I suspect the formatting will be lost.

            • 3. Re: combine text layers but keep text editable?  OR  A way to export text as a paragraph in InDesign into Photoshop
              GlossyBlacky Level 1

              A friend has just a problem with several hundred Photoshop files each containing multiple text layers

              This text layers should be combined in a new single editable text layer .
              The same problem as genericusermillion.
              Several attempts with Smart Objects Merge Layers etc. always led to a combined pixels or shape layer - just no editable text layer .
              In Photoshop forum I found no solution eg in the form of a script .

              Now i found the workaround with OCR in Acrobat

              The text is homogenous in all the photoshop files.

              A solution with a script would be better.


              Wolfgang

              • 5. Re: combine text layers but keep text editable?  OR  A way to export text as a paragraph in InDesign into Photoshop
                c.pfaffenbichler Level 8
                A friend has just a problem with several hundred Photoshop files each containing multiple text layers

                Could you post (screenshots of) examples?

                I have no idea how the text is set up (position and order of Type Layers for example), so a Scripting solution might be easy or close to impossible.

                 

                This text layers should be combined in a new single editable text layer .

                Again: Why? What do you need editable Type Layers for exactly?

                • 6. Re: combine text layers but keep text editable?  OR  A way to export text as a paragraph in InDesign into Photoshop
                  c.pfaffenbichler Level 8

                  I'm saving out from InDesign and for whatever reason the text is fragmented across many objects/layers/ whatever you want to call it.

                  Is the text in Indesign all in one Text container or distributed among several?

                  • 7. Re: combine text layers but keep text editable?  OR  A way to export text as a paragraph in InDesign into Photoshop
                    GlossyBlacky Level 1

                    Hi

                    attached two screenshoots with an easy example. Normaly the legend has 20-50 lines each with an separat text layer.

                    The original legend of the picture consists of several text layer (see smart object sreenshot). The text of this legend has to due to the printing black white background, a different font and due to mantaining and development of the content editable. Thus there might be some more lines added inbetween the existing one.

                    The second screenshot is the old legend as smart object (black) and the new legend as just one text layer.

                    So now its just one text layer easy editable. All the text layers have the same orientation.

                    Thanks for help.

                    Wolfgang

                     

                    Vorher-Smartobjekt-mit-vielen-Textlayern-1.jpg

                    Alt-(schwarz)-und-neu-(weiß)-nebeneinander-2.jpg

                    • 9. Re: combine text layers but keep text editable?  OR  A way to export text as a paragraph in InDesign into Photoshop
                      GlossyBlacky Level 1

                      Hi,

                      the headline is a extra text layer.

                      I wish only the selected text layers are combined in a new text layer (or textbox layer).
                      It would be very helpful if there is a solution.


                      Thanks Wolfgang

                      • 10. Re: combine text layers but keep text editable?  OR  A way to export text as a paragraph in InDesign into Photoshop
                        c.pfaffenbichler Level 8

                        You could give this a try:

                        // 2015, use it at your own risk;
                        #target photoshop
                        if(app.documents.length != 0){
                        var myDocument = app.activeDocument;
                        var originalRulerUnits = app.preferences.rulerUnits;
                        app.preferences.rulerUnits = Units.PIXELS;
                        ////////////////////////////////////
                        var theLayers = getSelectedLayersTextIdx();
                        selectLayerByIndex(theLayers[0][0]);
                        var theNewLayer = myDocument.activeLayer.duplicate();
                        var theBounds = theNewLayer.bounds;
                        var theString = "";
                        for (var n = 0; n < theLayers.length; n++) {theString = theString+"\r"+theLayers[n][1]};
                        theNewLayer.textItem.contents = theString;
                        var theNewBounds = theNewLayer.bounds;
                        theNewLayer.translate(theBounds[0]-theNewBounds[0], theBounds[1]-theNewBounds[1]);
                        ////////////////////////////////////
                        app.preferences.rulerUnits = originalRulerUnits;
                        };
                        ////////////////////////////////////
                        ////////////////////////////////////
                        ////////////////////////////////////
                        ////// based on paul mr’s code //////
                        function getSelectedLayersTextIdx(){
                        var selectedLayers = new Array;
                        var ref = new ActionReference();
                        ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
                        var desc = executeActionGet(ref);
                        if( desc.hasKey( stringIDToTypeID( 'targetLayers' ) ) ){
                        desc = desc.getList( stringIDToTypeID( 'targetLayers' ));
                        var c = desc.count
                        var selectedLayers = new Array();
                        for(var i=0;i<c;i++){
                        try{
                        activeDocument.backgroundLayer;
                        selectedLayers.push(  desc.getReference( i ).getIndex() );
                        }catch(e){
                        selectedLayers.push(  desc.getReference( i ).getIndex()+1 );
                        }
                        }
                        }else{
                        var ref = new ActionReference();
                        ref.putProperty( charIDToTypeID("Prpr") , charIDToTypeID( "ItmI" ));
                        ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
                        try{
                        activeDocument.backgroundLayer;
                        selectedLayers.push( executeActionGet(ref).getInteger(charIDToTypeID( "ItmI" ))-1);
                        }catch(e){
                        selectedLayers.push( executeActionGet(ref).getInteger(charIDToTypeID( "ItmI" )));
                        }
                        };
                        //return selectedLayers;
                        // check selected layers;
                        var theResult = new Array;
                        for (var m = 0; m < selectedLayers.length; m++) {
                        var ref = new ActionReference();
                        ref.putIndex( charIDToTypeID( "Lyr " ), selectedLayers[m]);
                        var layerDesc = executeActionGet(ref);
                        // if text layer;
                        if (layerDesc.hasKey(stringIDToTypeID('textKey')) == true) {
                        theResult.push([selectedLayers[m], layerDesc.getObjectValue(stringIDToTypeID('textKey')).getString(stringIDToTypeID('textKey')), layerDesc.getObjectValue(stringIDToTypeID('textKey')).getObjectValue(stringIDToTypeID("textClickPoint")).getUnitDoubleValue(stringIDToTypeID("vertical"))]);
                        };
                        };
                        // sort;
                        theResult.sort(sortArrayByIndexedItem)
                        return theResult
                        };
                        // by mike hale, via paul riggott;
                        // http://forums.adobe.com/message/1944754#1944754
                        function selectLayerByIndex(index,add){
                        add = undefined ? add = false:add
                        var ref = new ActionReference();
                            ref.putIndex(charIDToTypeID("Lyr "), index);
                            var desc = new ActionDescriptor();
                            desc.putReference(charIDToTypeID("null"), ref );
                              if(add) desc.putEnumerated( stringIDToTypeID( "selectionModifier" ), stringIDToTypeID( "selectionModifierType" ), stringIDToTypeID( "addToSelection" ) );
                              desc.putBoolean( charIDToTypeID( "MkVs" ), false );
                          try{
                            executeAction(charIDToTypeID("slct"), desc, DialogModes.NO );
                        }catch(e){
                        alert(e.message);
                        }
                        };
                        ////// sort a double array, thanks to sam, http://www.rhinocerus.net/forum/lang-javascript/ //////
                        function sortArrayByIndexedItem(a,b) {
                        var theIndex = 2;
                        if (a[theIndex]<b[theIndex]) return -1;
                        if (a[theIndex]>b[theIndex]) return 1;
                        return 0;
                        };
                        
                        

                         

                        Edit: The Type Layers get sorted only vertically at current, so if lines are split into more than one Type Layer that may produce mix-ups.

                        1 person found this helpful
                        • 11. Re: combine text layers but keep text editable?  OR  A way to export text as a paragraph in InDesign into Photoshop
                          GlossyBlacky Level 1

                          Hi pfaffenbichler,


                          the script works great - great job, helps a lot.

                          One-thanks for the great effort.

                          I would like to donate for this.

                          Best regards Wolfgang

                          • 12. Re: combine text layers but keep text editable?  OR  A way to export text as a paragraph in InDesign into Photoshop
                            c.pfaffenbichler Level 8

                            I forgot to include a check to verify the selected Layers contain Type Layer(s), so the Script would error if no Type Layer was selected.

                            // 2015, use it at your own risk;
                            #target photoshop
                            if(app.documents.length != 0){
                            var myDocument = app.activeDocument;
                            var originalRulerUnits = app.preferences.rulerUnits;
                            app.preferences.rulerUnits = Units.PIXELS;
                            ////////////////////////////////////
                            var theLayers = getSelectedLayersTextIdx();
                            if (theLayers.length > 1) {
                            selectLayerByIndex(theLayers[0][0]);
                            var theNewLayer = myDocument.activeLayer.duplicate();
                            var theBounds = theNewLayer.bounds;
                            var theString = "";
                            for (var n = 0; n < theLayers.length; n++) {theString = theString+"\r"+theLayers[n][1]};
                            theNewLayer.textItem.contents = theString;
                            var theNewBounds = theNewLayer.bounds;
                            theNewLayer.translate(theBounds[0]-theNewBounds[0], theBounds[1]-theNewBounds[1]);
                            } else {alert ("please select more than one type layer")};
                            ////////////////////////////////////
                            app.preferences.rulerUnits = originalRulerUnits;
                            };
                            ////////////////////////////////////
                            ////////////////////////////////////
                            ////////////////////////////////////
                            ////// based on paul mr’s code //////
                            function getSelectedLayersTextIdx(){
                            var selectedLayers = new Array;
                            var ref = new ActionReference();
                            ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
                            var desc = executeActionGet(ref);
                            if( desc.hasKey( stringIDToTypeID( 'targetLayers' ) ) ){
                            desc = desc.getList( stringIDToTypeID( 'targetLayers' ));
                            var c = desc.count
                            var selectedLayers = new Array();
                            for(var i=0;i<c;i++){
                            try{
                            activeDocument.backgroundLayer;
                            selectedLayers.push(  desc.getReference( i ).getIndex() );
                            }catch(e){
                            selectedLayers.push(  desc.getReference( i ).getIndex()+1 );
                            }
                            }
                            }else{
                            var ref = new ActionReference();
                            ref.putProperty( charIDToTypeID("Prpr") , charIDToTypeID( "ItmI" ));
                            ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
                            try{
                            activeDocument.backgroundLayer;
                            selectedLayers.push( executeActionGet(ref).getInteger(charIDToTypeID( "ItmI" ))-1);
                            }catch(e){
                            selectedLayers.push( executeActionGet(ref).getInteger(charIDToTypeID( "ItmI" )));
                            }
                            };
                            //return selectedLayers;
                            // check selected layers;
                            var theResult = new Array;
                            for (var m = 0; m < selectedLayers.length; m++) {
                            var ref = new ActionReference();
                            ref.putIndex( charIDToTypeID( "Lyr " ), selectedLayers[m]);
                            var layerDesc = executeActionGet(ref);
                            // if text layer;
                            if (layerDesc.hasKey(stringIDToTypeID('textKey')) == true) {
                            theResult.push([selectedLayers[m], layerDesc.getObjectValue(stringIDToTypeID('textKey')).getString(stringIDToTypeID('textKey')), layerDesc.getObjectValue(stringIDToTypeID('textKey')).getObjectValue(stringIDToTypeID("textClickPoint")).getUnitDoubleValue(stringIDToTypeID("vertical"))]);
                            };
                            };
                            // sort;
                            theResult.sort(sortArrayByIndexedItem)
                            return theResult
                            };
                            // by mike hale, via paul riggott;
                            // http://forums.adobe.com/message/1944754#1944754
                            function selectLayerByIndex(index,add){
                            add = undefined ? add = false:add
                            var ref = new ActionReference();
                                ref.putIndex(charIDToTypeID("Lyr "), index);
                                var desc = new ActionDescriptor();
                                desc.putReference(charIDToTypeID("null"), ref );
                                  if(add) desc.putEnumerated( stringIDToTypeID( "selectionModifier" ), stringIDToTypeID( "selectionModifierType" ), stringIDToTypeID( "addToSelection" ) );
                                  desc.putBoolean( charIDToTypeID( "MkVs" ), false );
                              try{
                                executeAction(charIDToTypeID("slct"), desc, DialogModes.NO );
                            }catch(e){
                            alert(e.message);
                            }
                            };
                            ////// sort a double array, thanks to sam, http://www.rhinocerus.net/forum/lang-javascript/ //////
                            function sortArrayByIndexedItem(a,b) {
                            var theIndex = 2;
                            if (a[theIndex]<b[theIndex]) return -1;
                            if (a[theIndex]>b[theIndex]) return 1;
                            return 0;
                            };