Skip to main content
Klаus
Inspiring
Nov 28, 2025 9:17 PM UTC
Question

GREP detecting »Yellow Lines«?

Hello!

 

Can I make GREP find and count every »yellow line« (due to Edit → Preferences → Composition → Highlight H&J Violations) within a given justified copy text?

 

Thanx

2 replies

Joel Cherney
Community Expert
Community Expert
Nov 28, 2025 10:26 PM UTC

Unfortunately, there there doesn't seem to be any way to do so.  Some years ago, someone asked how to track instances of H&J violations by script, and the response at that time was that no, you'd need a C++ plugin to track it.  That claim was followed by a very clever script that allows you to measure your current word spacing against the default non-justified spacing. I suppose it'd be possible to then build the script out further so that you could give it the default spacing, run the script, and get a count of all lines that have a spacing percent value outside of that defined by the default spacing? 

 

Seems like a lot of heavy lifting, in comparison to just scrolling through the document & counting them by hand.  Do you mind if I ask why you'd need to get a count of H&J violations? Perhaps there's some other way to get to your goal. 

Translate
Klаus
KlаusAuthor
Inspiring
Nov 28, 2025 11:39 PM UTC

Thanks for your reply, Joel!

Let’s assume I’m a typesetter who has to do the composition for a 100,000 words novel to be set in justified text. I am free (in a way) to chose the font, the point size and so on.

That’s why I’d like to know, which combination of the above mentioned things would result in the fewest »yellow lines«.

Translate