• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

tagged texts on a page

Explorer ,
Nov 23, 2016 Nov 23, 2016

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.

TOPICS
Scripting

Views

280

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Nov 23, 2016 Nov 23, 2016

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 23, 2016 Nov 23, 2016

Copy link to clipboard

Copied

something like that:

tags.JPG

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Nov 23, 2016 Nov 23, 2016

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 23, 2016 Nov 23, 2016

Copy link to clipboard

Copied

LATEST

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) )

        }  )

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines