Copy link to clipboard
Copied
Copy the code below and paste it in a plain text file. Save it with a .jsx extension. Click in the table and choose File > Script > Run and select the script. It should do what you want. Please let me know if you have any questions or comments.
main ();
function main () {
var doc;
doc = app.ActiveDoc;
if (doc.ObjectValid () === 1) {
processDoc (doc);
}
}
function processDoc (doc) {
var tbl;
// Make sure the cursor is in a table.
tbl = doc.Selec...
Copy link to clipboard
Copied
I assume that the attachment shows the "before" example. Can you post a screenshot of the result you want? Thank you.
Copy link to clipboard
Copied
Hi,
As I understand it, you want to merge all cells Data and Type, but only not in row 2, 3 and 4.
Do you want to keep the header Data and Type?
If there is only a single character in column Data, you could select all rows and remove the line between columns Data and Type and only keep this line for rows 2, 3 and 4.
However, when you really want to merge the cells in so many rows, then I recommend to get an ExtendScript script from one of the developers here.
Best regards, Winfried
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Then I guess you have to do it manually (takes two hours).
Or you could experiment with MIF.
When I tested this, the only difference is that you have to change this code:
<Cell
<CellContent
to this code:
<Cell
<CellColumns 2>
<CellContent
But to do a search/replace, you would have to search for the correct table cells. Not feasible.
Copy link to clipboard
Copied
To get more insight into MIF files, I recommend MIFBrowse.
Although it is rather old, it works very well.
http://www.grahamwideman.com/gw/tech/framemaker/mifbrowse.htm
Copy link to clipboard
Copied
Copy the code below and paste it in a plain text file. Save it with a .jsx extension. Click in the table and choose File > Script > Run and select the script. It should do what you want. Please let me know if you have any questions or comments.
main ();
function main () {
var doc;
doc = app.ActiveDoc;
if (doc.ObjectValid () === 1) {
processDoc (doc);
}
}
function processDoc (doc) {
var tbl;
// Make sure the cursor is in a table.
tbl = doc.SelectedTbl;
if (tbl.ObjectValid () === 1) {
if (app.Displaying === 1) {
app.Displaying = 0;
}
processTbl (tbl, doc);
if (app.Displaying === 0) {
app.Displaying = 1;
doc.Rehyphenate ();
doc.Redisplay ();
}
}
}
function processTbl (tbl, doc) {
var row, cell;
// Go to the first body row.
row = tbl.FirstRowInTbl.NextRowInTbl;
// Go to the second cell.
cell = row.FirstCellInRow.NextCellInRow;
// Loop through the cells in the second column.
while (cell.ObjectValid () === 1) {
if ((cell.CellIsStraddled === 0) && (cell.CellNumColsStraddled === 1)) {
if (cellToRightIsEmpty (cell) === true) {
cell.StraddleCells (1, 2); // rows, columns
}
}
cell = cell.CellBelowInCol;
}
}
function cellToRightIsEmpty (cell) {
var textList;
cell = cell.NextCellInRow;
if (cell.ObjectValid () === 1) {
if (cell.FirstPgf.id === cell.LastPgf.id) {
textList = cell.FirstPgf.GetText (Constants.FTI_PgfEnd);
if (textList[0].offset === 0) {
return true;
}
}
}
}
Copy link to clipboard
Copied
こんにちは。
ご返信ありがとうございます。早速職場に戻り次第スクリプト実行させていただきます。
また、結果をご報告させていただきます。
Copy link to clipboard
Copied
こんにちは
いつもお世話になっております。
スクリプト実行しました。まさに魔法のようでした。
見事に全ての行の連結が数秒で完了しました。凄いです。
私は、まだまだ未熟者でコメントさせてもらうと思いますのでよろしくお願いします。
ありがとうございました。
Find more inspiration, events, and resources on the new Adobe Community
Explore Now