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

Find all paragraphStyles of the document which are overriden

New Here ,
Jun 14, 2012 Jun 14, 2012

Hello there,

I want all the paragraph styles from the document which are overriden. Is there any way instead of iterating all paragraph styles?

Thanks in advance.

TOPICS
Scripting
1.1K
Translate
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
LEGEND ,
Jun 14, 2012 Jun 14, 2012

Nope.

Harbs

Translate
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
Advisor ,
Jun 15, 2012 Jun 15, 2012

hmm..

i can't test it right now but it might work like this:

iterate the paragraphs,

test myPara

if
(myPara.properties==app.activeDocument.paragraphStyles.itemByName(myPara.appliedParagraphStyle.name).properties)

{do something}

Translate
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
LEGEND ,
Jun 15, 2012 Jun 15, 2012

No. That will not work. Two different javascript objects will not pass an equality check.

You need to loop through all the properties...

Harbs

Translate
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
New Here ,
Jun 18, 2012 Jun 18, 2012
LATEST

Hello Harbs,

     Yes, you are right. The code sample provided by  Vamitul is not working. As there seems to be no such way to get all overriden paragraph styles without iterating all paragraphs, I am doing like this-

for(var cnt=0; cnt<app.activeDocument.textFrames[0].paragraphs.length; cnt++)

{

    var myPara = app.activeDocument.textFrames[0].paragraphs[cnt];

    if(myPara.styleOverridden)

        //alert(myPara.appliedParagraphStyle.name+" is overriden");

    else

        //alert(myPara.appliedParagraphStyle.name+" is not overriden");

}

Thanks.

Translate
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
Engaged ,
Jun 16, 2012 Jun 16, 2012

I think the easiest way is define a Preflight profile and extract the report.

Screen shot 2012-06-16 at 2.06.34 PM.png

Screen shot 2012-06-16 at 2.10.09 PM.png

Shonky

Translate
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