I have here a text in InDesign:
Hello (World),
this (nonsense) text
nobody (needs, right?).
With my jsx script I want to select the last match with brackets (needs, right?)
.
But this result is formatted with regular and italic (needs
is italic and the rest is regular). But I only want to change the regular style.
The part in my script looks like this:
function myFindGrep(myObject, mySearchString, mySearchStyle, myStyleGroup, myStyle){
app.changeGrepPreferences = NothingEnum.nothing;
app.findGrepPreferences = NothingEnum.nothing;
app.findGrepPreferences.findWhat = mySearchString;
app.findGrepPreferences.fontStyle = mySearchStyle;
app.changeGrepPreferences.appliedCharacterStyle = myDocument.characterStyleGroups.item(myStyleGroup).characterStyles.item(myStyle);
var myFoundItems = myObject.changeGrep();
app.changeGrepPreferences = NothingEnum.nothing;
app.findGrepPreferences = NothingEnum.nothing;
}
myFindGrep(selText.paragraphs.item(x), "\(.+?\)", "Regular", "Meist genutzte", "Zitat Regular");
When I apply this, it change my hole selection except the italic Text...
Is there a way to fix this?