Copy link to clipboard
Copied
How can I get all tagged texts on particular page?
Tagged text can be located in text frames grouped with another objects.
Copy link to clipboard
Copied
Hi,
Describe more what you mean by 'tagged'.
InDesign can import or export tagged text, but inside InDesign doc (in textFrames) there is formatted text.
How your tags looks like?
Jarek
Copy link to clipboard
Copied
something like that:
Copy link to clipboard
Copied
So we are talking about XML structure...
XMLElement parent can be a document or another XMLElement.
But...
If you find every textFrame on your page - you can call each textFrame.texts[0].associatedXMLElements. This is an array of XMLElements - each of them has 'contents' and 'markupTag' property.
Jarek
Copy link to clipboard
Copied
So this is my try.
Maybe someone will find this useful.
(whose method is defined elswhere)
var items = myPage.allPageItems.whose
( function(item){
return(item instanceof TextFrame)
} )
var bb, myXMLelements = []
while (bb = items.pop()) {
myXMLelements = myXMLelements.concat(bb.texts.everyItem().associatedXMLElements[0])
}
myXMLelements = myXMLelements.whose(
function(ob){
return (ob.markupTag.name != "Story" && (ob.xmlContent instanceof Text) )
} )