Loop to know fonts used in a document Error in script
Error in this line: var fontName = textFrames[i].textRange.characterAttributes.textFont.name;
Here is the code:
var textFrames = app.activeDocument.textFrames;
// Create an object to store
var usedFonts = {};
// Loop through all text frames
for (var i = 0; i < textFrames.length; i++) {
var fontName = textFrames[i].textRange.characterAttributes.textFont.name;
if (!usedFonts[fontName]) {
usedFonts[fontName] = true;
}
}
for (var font in usedFonts) {
$.writeln(font);
}
