Hi,
Following the Harbs solution on https://creativepro.com/using-grep-to-make-a-character-lowercase.php,
finds = app.documents[0].findGrep();
for(i=0;i<finds.length;i++){
finds[i].contents=finds[i].contents.toLowerCase();
}
I tried to combine my GREP search in the code, but it didn’t work…
app.findGrepPreferences = null;
finds = app.findGrepPreferences.properties = ({findWhat:"[A-Z]"});
style = getStyleByString(doc, 'Letter ID', 'characterStyles');
for(i=0;i<finds.length;i++){
finds[i].contents=finds[i].contents.toLowerCase();
}
…where “Letter ID” is the character style associated with the search.
i.e. I want to change all the letters (A to Z) with “Letter ID” character style applied to lowercase.
Can someone edit the code so that I do not have to write a search first in my GREP Find/Change and then run the script.
I think it is more convenient if two things can be merged together.
I’m on InDesign CC 2019.
Thanks in advance.