Skip to main content
Robert at ID-Tasker
Legend
Aug 4, 2024 2:02 PM UTC
Question

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

Looks like a bug to me?

 

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

 

 

 

 

 

 

This topic is closed to new replies. Start a new post to keep the conversation going.

8 replies

rob day
Community Expert
Community Expert
Aug 5, 2024 12:05 PM UTC

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
Translate
Robert at ID-Tasker
Legend
Aug 5, 2024 12:07 PM UTC

@rob day

 

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

 

Translate
Peter Kahrel
Community Expert
Community Expert
Aug 4, 2024 3:24 PM UTC

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.

Translate
Robert at ID-Tasker
Legend
Aug 4, 2024 3:36 PM UTC

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

 

Translate
m1b
Community Expert
Community Expert
Aug 4, 2024 7:42 PM UTC

Conceptually a word is not a "building block" in the same way that character is. If I was writing a word-parser I probably would opt to to treat non-glyph characters as word boundary markers, ie. not part of a word. So my parser would return zero too. 
- Mark

Translate