Copy link to clipboard
Copied
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.
Regards,
Velu
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
Copy link to clipboard
Copied
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";
}
Copy link to clipboard
Copied
Hi Steven,
Thanks for your script. I will check it.
Regards,
Velu
Copy link to clipboard
Copied
Steve,
Script working fine. if there any possibilities to change the entire file.
Applied Column head style is "TCH"
Regards,
Velu
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Hi Kai,
Script is working fine.
Thanks for the update.
Regards,
Velu
Find more inspiration, events, and resources on the new Adobe Community
Explore Now