Skip to main content
Participant
Mar 24, 2025 11:11 AM UTC
Answered

Unable to Extract Notes from Table Cells

Hi,

 

I am able to extract note contents from a story using the following code:

alert(app.activeDocument.stories[0].notes[0].texts[0].contents);

 

However, when I try to extract note contents from a table, it does not work:

alert(app.activeDocument.stories[0].tables[0].cells[0].notes[0].texts[0].contents);

 

Could someone guide me on the correct approach to extract notes from table cells in InDesign JavaScript?

 

Thanks!

m1b
m1bCorrect answer
Community Expert
Mar 24, 2025 2:25 PM UTC

The notes are properties of text objects, so you must access the text of the cell:

alert(app.activeDocument.stories[0].tables[0].cells[0].texts[0].notes[0].texts[0].contents);

- Mark 

2 replies

Robert at ID-Tasker
Legend
Mar 24, 2025 2:27 PM UTC

@Sajeev_Sridharan

 

Cell is like a Story - so you need to use a reference to its text - .cells[0].texts[0] - anyway.

 

Translate
m1b
Community Expert
m1bCommunity ExpertCorrect answer
Community Expert
Mar 24, 2025 2:25 PM UTC

The notes are properties of text objects, so you must access the text of the cell:

alert(app.activeDocument.stories[0].tables[0].cells[0].texts[0].notes[0].texts[0].contents);

- Mark 

Translate