`myText` is not proper variable name, this is Cell Object.
var myText = myTable.rows.cells; var scriptLabel = myText.toString();
I guess using `appliedParagraph.name` to Cell's Text solve your issue.
Sorry but can you explain further?
I've tried the below code but get an error message -
var scriptLabel = myTable.rows.cells.appliedParagraph.name;
myCell.pageItems.label = scriptLabel;
look up the DOM documentation and Help files of the ESTK.
Some valuable links in this thread here:
Object Cell has a texts property.
And object Texts has appliedParagraphStyle property. Not appliedParagraph.
And appliedParagraphStyle is indeed a PargaraphStyle, that has a name property.
And if the value of name is what you are after you can do it like that:
var scriptLabel = myTable.rows.cells.texts.appliedParagraphStyle.name;
because the value of name is a String object.
Labels can hold only Strings as value.
What exactly is behind variable myCell ?
And is a pageItem pasted in myCell?
Or is myCell a graphic cell and pageItems is the container of an image that sits in the cell?
Note: You can also use the cell itself to label it.
myCell.label = scriptLabel;
And if you select the cell and the Script Label panel is open you will see the value of the label.
Example from my German InDesign CC 2017:
( Skriptetikett => Script Label , [Kein Absatzformat] => [No Paragraph Style] )
If you go through the cells using the arrow keys, the script label is changing, because I applied different paragraph styles and labeled all the cells: