Skip to main content
Participating Frequently
March 15, 2021
Question

Script for avoiding rivers

  • March 15, 2021
  • 2 replies
  • 877 views

I have 10,000 names that need to be flowed into multiple linked text boxes. As the names are different lengths, I am getting some bad rivers. I'd like to find a script that will re-arrange the names (they don't have to be in any particular order), in order to best minimize bad rivers. Hope this makes sense.

Any ideas, anyone?

2 replies

Mike Witherell
Community Expert
Community Expert
July 12, 2025

Hi David,

You might first try some basic settings:

Kerning set to optical

Hyphenation set to:

9, 3, 4, 1, off, off, off 

Justification set to:

80/100/120

-5/0/5%

95/100/105

 

You don't mention whether this is align-left or fully justified left and right, but these basic settings will minimize rivers. Especially the Justification settings.

 

If your list of names is in a spreadsheet, you will likely find a macro/formula that can randomize the names, rather than trying to do this once placed into InDesign. For example:

https://answers.microsoft.com/en-us/msoffice/forum/all/how-do-i-do-a-random-sort/2be58151-2797-444f-a9c6-bfaaef83cbfa

 

Mike Witherell
rob day
Community Expert
Community Expert
March 15, 2021

Word and letter spacing for justified text is controlled by the paragraph’s Justification and Composer settings. Changing those setting will affect the rivers. Can you post a screen capture?

Participating Frequently
March 15, 2021

Yes, I know that. I need a script that will re-arrange the words, within the same space, in order to minimize the rivers.

Peter Kahrel
Community Expert
Community Expert
March 15, 2021

I'm not aware of such a script. It's not easy, and will be slow to run because you need to get all the spaces on a page and work out where they are and which ones overlap partially ('partially' should be defined) for a defined number of lines. It'll be quite a challenge.