Skip to main content
Robert at ID-Tasker
Legend
August 4, 2024
Frage

Words collection is empty in Story with ONLY Tables in separate Paragraphs...

  • August 4, 2024
  • 2 Antworten
  • 399 Ansichten

Looks like a bug to me?

 

Words collection for a Story - or Paragraph - that has ONLY Tables - is empty...

 

 

 

 

 

 

Dieses Thema wurde für Antworten geschlossen.

2 Antworten

rob day
Community Expert
Community Expert
August 5, 2024

Words collection for a Story - or Paragraph - that has ONLY Tables - is empty...

 

The word collection for a story with multiple returns or white spaces also empty.

 

 

var i = app.activeDocument.stories.everyItem().insertionPoints.everyItem().getElements();
$.writeln(i.length)
//returns 15

var w = app.activeDocument.stories.everyItem().words.everyItem().getElements();
$.writeln(w.length)
//returns 0
Robert at ID-Tasker
Legend
August 5, 2024

@rob day

 

Yes, words are build from letters, so empty paragraph or space won't return words.

 

Peter Kahrel
Community Expert
Community Expert
August 4, 2024

Well, depends on how you look at it. From InDesign's perspective it's consistent. A table sits in a placeholder that's dubbed Character, but it's not a character in the sense of a glyph. When you (grep) search . (any character( you won't find anything.

 

The same goes for embedded frames, you get the same results.

Robert at ID-Tasker
Legend
August 4, 2024

But "it occupies some space" in the collection of characters? And even one letter words are words?

 

rob day
Community Expert
Community Expert
August 4, 2024

Hi @Robert at ID-Tasker , Look at table properties—there is the storyOffset, which is the insertionPoint I think @Peter Kahrel  is referring to.

 

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#Table.html