Quantcast
Channel: Adobe Community: Message List - InDesign Scripting
Viewing all articles
Browse latest Browse all 37788

Re: Find and change GREP characters

$
0
0

Hi,

 

I see...

 

What about this:

 

app.findGrepPreferences = app.changeGrepPreferences = null;
app.findGrepPreferences.findWhat  = "(\\<.+\\>)\\s*$";
app.findGrepPreferences.appliedCharacterStyle = "italic";
app.changeGrepPreferences.changeTo =  "~m\$1";
myDoc.changeGrep();

 

if your goal is the last word not preceded by any space replace this line;

app.findGrepPreferences.findWhat  = "(?<!\\s)(\\<.+\\>)$";

 

rgds

Jarek


Viewing all articles
Browse latest Browse all 37788


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