Loop through styles not working as intended.
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.appliedFont == "Times New Roman (OTF)") {alert()}
};
for (b=1; b < myDocument.allCharacterStyles.length; b++) {
if(myDocument.allCharacterStyles.appliedFont == "Times New Roman (OTF)") {alert()}
};