Cell object is null!
I get the third merged cell as null. Why is that?
Please to get the error First create new document and table 3 by 3 and merge and select cells like screenshot. Execute the script.
var sel = app.selection[0];
var queuedCells = getQueuedCells ([sel]);
function getQueuedCells (deepCells) {
var queuedCells = new Array;
if (deepCells.length > 0) {
targetIndex = null;
targetIndex = deepCells[0].parentRow.index;
for (var dcs = 0; dcs < deepCells.length; dcs++) {
for (var dcc = 0; dcc < deepCells[dcs].cells.length; dcc++) {
alert ("(deepCells[" + dcs + "].cells[" + dcc + "] != null) " + (deepCells[dcs].cells[dcc] != null));
if (targetIndex == deepCells[dcs].cells[dcc].parentRow.index) {
queuedCells.push (deepCells[dcs].cells[dcc]);
}
}
}
}
return queuedCells;
}
-
Abdulaziz Junaid commented
About InDesign:
-
Abdulaziz Junaid commented
I executed the following code and get 2 in first screenshot and 3 in the second.
var r = app.selection[0].cells.everyItem().getElements();
alert (r.length); -
Abdulaziz Junaid commented
I posted this here also:
https://community.adobe.com/t5/indesign-discussions/cell-object-is-null/td-p/13180932