Quantcast
Channel: Adobe Community : Popular Discussions - InDesign Scripting
Viewing all articles
Browse latest Browse all 15932

Loop through styles not working as intended.

$
0
0

I'm trying to loop through all the styles in a number of documents and locate any styles with the font "Times New Roman (OTF)." Unfortunately, no matter how I tweak the script, it won't trigger the alert where and when it should. Any ideas? Thanks!

 

var myDocument = app.activeDocument;
for (a=1; a < myDocument.allParagraphStyles.length; a++) {    if(myDocument.allParagraphStyles[a].appliedFont == "Times New Roman (OTF)") {alert()}    };
for (b=1; b < myDocument.allCharacterStyles.length; b++) {    if(myDocument.allCharacterStyles[b].appliedFont == "Times New Roman (OTF)") {alert()}    };

Viewing all articles
Browse latest Browse all 15932

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>