Question
How to make this script select all cells in the currently selected column at once?
I've observed that the script below selects the column in two separate steps.
selectCellForCurrentFrame();
function selectCellForCurrentFrame() {
var item = app.selection[0];
var col = item.columns
//Cyclic column
for (var c = 0; c < col.length; c++) {
var cel = col[c].cells;
//var textFrame = app.selection[0].parent.parent;
var rangeOfCells =
cel.everyItem().getElements();
//Look here carefully—each column has been selected.
alert(rangeOfCells);
var cellsToSelect = [];
for (var n = 0; n < rangeOfCells.length; n++) {
if (rangeOfCells[n].rowType == RowTypes.BODY_ROW
) {
cellsToSelect[cellsToSelect.length++] = rangeOfCells[n];
}
};
app.select(cellsToSelect[0]);
for (var n = 1; n < cellsToSelect.length; n++) {
app.select(cellsToSelect[n], SelectionOptions.ADD_TO)
};
}
};
