5 Replies Latest reply on May 22, 2015 12:57 AM by VeluVK

    Soft enters for table column head breakup

    VeluVK

      Hi,

       

      Can i have any option for the the below requirement?

       

      I need to give soft enters for all table column head breakup's. (see the below screen shot). When i export to HTML the column heads are run-in against the PDF output.

       

      Softenters.jpg

       

      Regards,

      Velu

        • 1. Re: Soft enters for table column head breakup
          Stefan Rakete Level 2

          place your cursor in the cell and start this script. Hope this helps:

           

          var curSel = app.selection[0];

          var curParentCell = curSel.parent;

          var curCellText = curParentCell.texts[0];

          var allLines = curCellText.lines;

          for (var i=0; i<allLines.length-1; i++) {

              var curLine = allLines[i];

              curLine.insertionPoints.lastItem().contents = "\n";

          }

          • 2. Re: Soft enters for table column head breakup
            VeluVK Level 1

            Hi Steven,

             

            Thanks for your script. I will check it.

             

             

            Regards,

            Velu

            • 3. Re: Soft enters for table column head breakup
              VeluVK Level 1

              Steve,

               

              Script working fine. if there any possibilities to change the entire file.

               

              Applied Column head style is "TCH"

               

              Regards,

              Velu

              • 4. Re: Soft enters for table column head breakup
                Kai Rübsamen Adobe Community Professional

                Hi Velu,

                 

                try the following:

                 

                var curDoc = app.activeDocument;
                var allTables = curDoc.stories.everyItem().tables.everyItem(); 
                
                app.findTextPreferences = app.changeTextPreferences = null;
                app.findTextPreferences.appliedParagraphStyle = curDoc.paragraphStyles.itemByName("TCH"); 
                
                var allFounds = allTables.findText();
                app.findTextPreferences = app.changeTextPreferences = null;
                
                for ( var i = 0; i < allFounds.length; i++ ) {
                    var tableFound = allFounds[i];
                    if ( tableFound.length > 0 ) {
                        for ( var j = 0; j < tableFound.length; j++ ) {
                            var curFound = tableFound[j];
                                    var allParaLines = curFound.lines;
                                    for (var n = allParaLines.length-2; n >= 0 ; n--) {
                                        var curLine = allParaLines[n];                        
                                        if (curLine.characters[-1].contents != SpecialCharacters.FORCED_LINE_BREAK) {
                                            curLine.insertionPoints[-1].contents = "\n";
                                        } // end if
                                    } // end for
                        } // end for
                    } // end if
                } // end for
                

                 

                –Kai

                • 5. Re: Soft enters for table column head breakup
                  VeluVK Level 1

                  Hi Kai,

                   

                  Script is working fine.

                   

                  Thanks for the update.

                   

                  Regards,

                  Velu