Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Nope.
Harbs
Copy link to clipboard
Copied
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}
Copy link to clipboard
Copied
No. That will not work. Two different javascript objects will not pass an equality check.
You need to loop through all the properties...
Harbs
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
I think the easiest way is define a Preflight profile and extract the report.
Shonky
Find more inspiration, events, and resources on the new Adobe Community
Explore Now