I have an xml element that corresponds to a textFrame. The xml element has two children corresponding to picture boxes. Now I want to read in xml and fill textFrame and picture boxes. Before doing this I need to empty the textFrame.
Unfortunately xml.texts.contents="" also deletes the picture boxes.
The only rather silly solution I have found is to step thru all xml.characters and test for the number of associatedXMLElements. "Real" characters have one the picture boxes have two.
There must be a more sensible way but I cannot think of any.
Check for the story.pageItems. That will give you all inlines.
Checking the parent.index will give you the index of the containing character. Once you know where they are, you can use itemByRange() to get rid of the text-only.
Thank you, Harbs. The problem is I cannot find any pageItems.
The xml object does have a parentStory but the parentStory contains no pageItems. The xml does not contain stories. I can get xml.texts, but this also does not have any pageItems. I am quite confused.