Skip to main content
M.Hasanin
Inspiring
September 29, 2022
Answered

How to Exclude Master / Parent pages from the words collection?

  • September 29, 2022
  • 1 reply
  • 306 views

Hi Experts.

in this words collection it will include all the words in current doc plus the words in master / parent pages

 

words = app.documents[0].stories.everyItem().words.everyItem().getElements(); //Include Master Pages

 

my question how to modify it to only collect words in the current document and exclude master/parent pages ? and thanks in advance 

This topic has been closed for replies.
Correct answer brian_p_dts

I believe you'd have to cobble the collection together looking at doc.spreads text frames and their parent stories. Or you can write something to duplicate the master spreads to a temp doc, remove them, then bring them back. Probably more of a headache though. 

1 reply

brian_p_dts
Community Expert
brian_p_dtsCommunity ExpertCorrect answer
Community Expert
September 29, 2022

I believe you'd have to cobble the collection together looking at doc.spreads text frames and their parent stories. Or you can write something to duplicate the master spreads to a temp doc, remove them, then bring them back. Probably more of a headache though. 

M.Hasanin
M.HasaninAuthor
Inspiring
September 29, 2022

Thanks a lot @brian_p_dts 

Mohammad Hasanin