Reply To: Grep script: Search for "?.+" and apply character style?

#33908
frankeman90
Member

Finally got it to work with the script below. But do you know how I can make this only affect the selected text / text frame?

app.findGrepPreferences=app.changeGrepPreferences=null;

app.findGrepPreferences.findWhat=”?(.+)$”;

app.changeGrepPreferences.changeTo=”$1″;

app.changeGrepPreferences.appliedParagraphStyle=”APPLE”;

app.activeDocument.changeGrep();

app.findGrepPreferences.findWhat=”?(.+)$”;

app.changeGrepPreferences.changeTo=”$1″;

app.changeGrepPreferences.appliedParagraphStyle=”BANANA”;

app.activeDocument.changeGrep();

This article was last modified on June 13, 2013

Comments (0)

Loading comments...