Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

GREP to remove runts in a contact listing within a paragraph

Explorer ,
Jul 28, 2021 Jul 28, 2021

In my job, we create basically a phone book. Each entry is a paragraph, but each field of data is separated by a forced line break. If a company name is too long in the column, it will create a runt/cliff withing the boundary of the beginning of the paragraph to the end of the field of data (the forced line break). Is there a GREP I can run to identify when these happen? Note that I want to identify these, NOT do a change all. 

 

In theory what I want is to search for a single word on a line that has a forced line break at the end, but has no "beginning" other than it being on a second line. 

 

Does that make sense?

TOPICS
How to
2.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guide , Jul 30, 2021 Jul 30, 2021

Just For Fun!

 

(^/)  The Jedi

 

Capture d’écran 2021-07-30 à 19.09.10.png

 

/*
    _FRIdNGE-0728_LineRunt.jsx
    by FRIdNGE, Michel Allio [30/07/2021]
*/

var myDoc = app.activeDocument;

var myCondition = myDoc.conditions.item("runt");
if (!myCondition.isValid) myCondition = myDoc.conditions.add ({name: "runt", indicatorMethod: ConditionIndicatorMethod.USE_HIGHLIGHT, indicatorColor: [255,186,131]});

var myStories = myDoc.stories,
S = myStories.length,  s;
for ( s = 0; s < S ; s++ ) {
    var myParas = myStories[s].paragraphs,
    P = myP
...
Translate
Explorer ,
Jul 30, 2021 Jul 30, 2021

Perfect! This is the best iteration that I needed! You're going to make my job so much easier. Thank you thank you thank you!

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 30, 2021 Jul 30, 2021

Aw heck! I was getting so close! Thanks for the tutorial on how to use conditions and indicators, I suppose. 🙂

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines