Easier to just do this rather than rely solely on GREP.
app.findGrep returns an array of Character that you can then loop through to find containing paragraph and execute on the lines.
//CLEAN GREP
app.findGrepPreferences = null;
app.changeGrepPreferences = null;
//GET FIND GREP
app.findGrepPreferences.findWhat="~a";
var myFinds = app.findGrep(true);
for (var i = 0; i < myFinds.length; i++) {
try {
myFinds[i].leading = 20;
myFinds[i].baselineShift = -10;
myFinds[i].paragraphs[0].lines[1].leading = 20;
} catch(e) {
continue;
}
}
app.findGrepPreferences = null;
app.changeGrepPreferences = null;
Hi Brian! 😉
Change:
myFinds[i].paragraphs[0].lines[1].leading = 20;
by:
myFinds[i].lines[0].insertionPoints[-1].lines[0].leading = 20;
or, less greedy (only the first char of the next line):
myFinds[i].lines[0].insertionPoints[-1].lines[0].characters[0].leading = 20;
(^/) The Jedi