Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Soft enters for table column head breakup

Explorer ,
Apr 15, 2015 Apr 15, 2015

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

TOPICS
Scripting
616
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Apr 17, 2015 Apr 17, 2015

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;

    if ( tableFound.length > 0 ) {

        fo

...
Translate
Engaged ,
Apr 16, 2015 Apr 16, 2015

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;

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

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 17, 2015 Apr 17, 2015

Hi Steven,

Thanks for your script. I will check it.

Regards,

Velu

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 17, 2015 Apr 17, 2015

Steve,

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

Applied Column head style is "TCH"

Regards,

Velu

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Apr 17, 2015 Apr 17, 2015

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;

    if ( tableFound.length > 0 ) {

        for ( var j = 0; j < tableFound.length; j++ ) {

            var curFound = tableFound;

                    var allParaLines = curFound.lines;

                    for (var n = allParaLines.length-2; n >= 0 ; n--) {

                        var curLine = allParaLines;                       

                        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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 22, 2015 May 22, 2015
LATEST

Hi Kai,

Script is working fine.

Thanks for the update.

Regards,

Velu

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines