Quantcast
Channel: Adobe Community : Popular Discussions - InDesign Scripting
Viewing all articles
Browse latest Browse all 15932

Find and change GREP characters

$
0
0

Hi,

 

Is It possible to find and change a word (or character style)  in the end of each paragraph line from a finded text.

 

Is It possible to do this with a script?

 

Sample.jpg
my Script

app.findGrepPreferences.appliedCharacterStyle = "Italic";

myFind = myDoc.findGrep();

for(i=0; i<myFind.length;i++){

       myIndex = myFind[i].paragraphs[-1].parentStory.characters[myFind[i].index-1];
    myIndex.contents  =  SpecialCharacters.EM_SPACE;
}
But its find all the italic styles and insert EM space.
I need to change only the end of the line character Style("Italic")

Any help would be great.

 

Hurix


Viewing all articles
Browse latest Browse all 15932

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>