How to check what paragraph style the structure is aplied?

New Here ,
Dec 15, 2021 Dec 15, 2021

Copy link to clipboard

Copied

Hello everyone.

I have the structure:

wfrsilva_0-1639596868699.png

I need to check the wicht Paragraph Style the "titulo" (tittle) structure  is applied.
Should be also "titulo" Paragraph style, but during the use of the document, someone can accidentally change this paragraph style and I want to check with extend script.

var estGrupos = rootElement.evaluateXPathExpression("//folha/grupo/nomeGrupo");
var estEntidades = estGrupos[g].parent.evaluateXPathExpression("//entidade/nomeEntidade");

var estAtosTitulo = estEntidades[e].parent.evaluateXPathExpression("//ato/titulo");

if(estAtosTitulo[t].markupTag.name == "titulo"){
                    $.writeln("estAtosTitulo[t] titulo == " + estAtosTitulo[t].contents + " - " + nomeCodAto)
}//if

 

I know there I take the Tag, but i need take the paragraph style.
Please, How do I do that?

TOPICS
Bug , How to , Scripting , Type

Views

50

Likes

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

correct answers 1 Correct answer

New Here , Dec 16, 2021 Dec 16, 2021
First i chandged the way to captch the correct structure estTitulos = myDocument.xmlElements[0].evaluateXPathExpression("grupo/entidade/ato/titulo");And ... Before I tried  if(estTitulos[i].appliedParagraphStyle.name !== "titulo"){ //TODO } This show me a Object Error because XMLElement don't have appliedParagraphStyle,But have paragraphs, and paragraphs have appliedParagraphStyle. (Thanks to my friend Rodrigo "Mundinho").So the correct is: if(estTitulos[i].paragraphs[0].appliedParagraphS...

Likes

Translate

Translate
New Here ,
Dec 16, 2021 Dec 16, 2021

Copy link to clipboard

Copied

LATEST
First i chandged the way to captch the correct structure

 

estTitulos = myDocument.xmlElements[0].evaluateXPathExpression("grupo/entidade/ato/titulo");

And ...
Before I tried 

 

 

 

if(estTitulos[i].appliedParagraphStyle.name !== "titulo"){
  //TODO
}

 

 

This show me a Object Error because XMLElement don't have appliedParagraphStyle,
But have paragraphs, and paragraphs have appliedParagraphStyle. (Thanks to my friend Rodrigo "Mundinho").
So the correct is:

 

 

if(estTitulos[i].paragraphs[0].appliedParagraphStyle.name !== "titulo"){
    $.writeln("This structure may be TITULO Paragraph Style. But don´t is. Please, check this.");
}

 

 

 

Likes

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