Skip to main content
Participating Frequently
Mar 15, 2021 10:21 AM UTC
Question

Script for avoiding rivers

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?

6 replies

Mike Witherell
Community Expert
Community Expert
Jul 12, 2025 10:33 AM UTC

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

 

Translate
Mike Witherell
rob day
Community Expert
Community Expert
Mar 15, 2021 1:05 PM UTC

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?

Translate
Participating Frequently
Mar 15, 2021 1:45 PM UTC

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

Translate
Peter Kahrel
Community Expert
Community Expert
Mar 15, 2021 9:46 PM UTC

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.

Translate