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

GREP expression for last line followed by column break

$
0
0

For all those reading this, thank you for taking the time to help. I'm a noob at GREP expressions and JavaScript so I appreciate all your time and help with this.

 

I've written a JavaScript to help my company format some of our work quicker. We have pre-made templates with Character Styles all set up (Body, Header, BodyItalic) etc.

 

My script works nearly perfectly for identifying patterns and applying the correct Character style.

 

However my expressions don't work perfectly and any last line of text in the text box (linked), that has a column break, does not get formatted.

 

This last line is always different depending on the document. So I can't put in constants. They are always variables.

 

 

My current GREP expression is .+~M which in theory should find any character that repeats one or more times and is followed by a column break. The problem is, it only finds the last two characters on the line that are followed by a column break.

 

e.g.

 

Tribute would be TribuTE

 

Eulogy would be EuloGY

 

etc etc

 

As you can see, they are not always the same words, and could even be a short sentence so I can't just tell it to look for certain words.

 

I'm trying to work out why the GREP expression doesn't work. Maybe I'm using the wrong GREP symbols? I don't know, so any assistance would be much appreciated.

 

Thank you in advance.

 

Scorpio


Viewing all articles
Browse latest Browse all 15932

Trending Articles



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