Skip to main content
Participant
March 24, 2025
Answered

Unable to Extract Notes from Table Cells

  • March 24, 2025
  • 2 replies
  • 165 views

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!

Correct answer m1b

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
March 24, 2025

@Sajeev_Sridharan

 

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

 

m1b
Community Expert
m1bCommunity ExpertCorrect answer
Community Expert
March 24, 2025

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