Label error Table 1 x 1 cell
Version
InDesign CC for Teams 2018 (13.0.1) ExtendScript (Javascript)
Steps
scenario 1
- create table (1 cell, 1 row)
- select cell with [ESC]-key
- change label via Javascript
app.selection[0].cells[0].label = "abc";
$.writeln(app.selection[0].cells[0].label);
- actual result in ESTK --> "abc"
- actual result in Indesign -> Scriptlabel--> empty window (expected result: "abc" expected)
scenario 2
- create Table (1 cell, 1 row)
- select cell with [ESC]-key
- change label manually via Indesign -> Scriptlabel-Window to "abc"
app.selection[0].cells[0].label = "";
$.writeln(app.selection[0].cells[0].label);
- actual result in ESTK --> ""
- actual result in Indesign -> Scriptlabel--> "abc" (expected result: empty window)
scenario 1 + 2
- add a second row
- label in first row is correct
label in second (new row) same as in row 1
remove added row
the label changes back to the false (actual) results as described in scenarios 1 and 2
-
Uwe Laubender commented
Hi,
that is no bug.Test the following:
app.selection[0].cells[0].label = "cell";
app.selection[0].label = "table";What will the Script Label window show?
It's showing the label of the tabel, because you selected a whole table.
And not the one and only cell of that table.You might also see into this:
app.selection[0].constructor.nameRegards,
Uwe -
Peter Kahrel commented
Selecting the single cell in a 1-cell table has the same effect as selecting all cells in a multi-cell table: app.selection[0] returns Table, not Cell. To set the label of a cell, select the cell the way you did and do
app.selection[0].cells[0].label = 'abc';
Peter