Texts in bold style
Hi everyone,
I want to create a script that finds all block texts in bold style and changes the format of the first letter of every word found in bold.
My script is not working, and I don't have enough knowledge to correct it.
Please could you help me:
if (app.documents.length === 0) {
alert("Nenhum documento está aberto!");
} else {
var doc = app.activeDocument;
if (doc.stories.length === 0) {
alert("O documento não contém nenhuma história de texto!");
} else {
for (var i = 0; i < doc.stories.length; i++) {
var story = doc.stories[i];
for (var j = 0; j < story.paragraphs.length; j++) {
var para = story.paragraphs[j];
for (var k = 0; k < para.words.length; k++) {
var word = para.words[k];
if (word.characters.length > 0 && word.characters[0].appliedFont.fontStyleName.toLowerCase().includes("heavy")) {
word.characters[0].pointSize = 18;
}
}
}
}
alert("Texto no estilo Heavy encontrado e ajustado!");
}
}
