is now part of CreativePro.com!

Free Script for Removing the Overlapping Stroke for Paragraph Borders

8

As you probably know, InDesign now lets you create borders (or strokes) around one or more paragraphs. It’s a cool feature, but there’s a problem: If you put a border around two or more paragraphs next to each other, the borders often overlap. Fortunately, there’s an easy fix, and even a free script that can fix it super fast.

First of all, you need to know that when you select one or more paragraphs, you can turn on the Border checkbox in the Control panel:

adding a border to a paragraph

If you Alt/Option-click on the little icon to the right of that Border checkbox, it opens the Paragraph Borders and Shading dialog box, where you can set up the stroke thickness, offset, corner styles, positioning, and so on:

borders and shading

Notice that in the image above, the stroke is 1 pt on all four sides of the paragraph, and the stroke is offset 3 pt from the side of the text. If you apply that to two paragraphs next to each other, you’ll get a result like this:

Borderscript2

So… that’s not pretty…

The solution is straightforward: You need to select the first paragraph, open the Paragraph Borders and Shading dialog box, and set the bottom stroke to zero; then select the last paragraph and set the top stroke to zero.

If this were three or more paragraphs, you’d of course also need to select those in the middle and set the top and bottom strokes to zero.

And, because you’re probably going to be making paragraph styles for these, you’d need three different paragraph styles—one for each of these types of paragraphs.

Here’s how it looks after making those changes:

after running the script

I have personally told Adobe that we need a better solution… we should be able to do this with a single paragraph style. But it’s kind of tricky because each paragraph needs to know what other paragraphs are before and after it. Anyway, I hope they’ll fix this. (And if they do, we’ll update this blog post.)

Fortunately, Peter Kahrel wrote a short little script that handles most of the boring work for you. You just select the paragraphs that have borders and double-click his script, and it quickly runs through each paragraph, removing the unnecessary strokes. You can download the script here. If you need help installing scripts, you can find that here.

David Blatner is the co-founder of the Creative Publishing Network, InDesign Magazine, CreativePro Magazine, and the author or co-author of 15 books, including Real World InDesign. His InDesign videos at LinkedIn Learning (Lynda.com) are among the most watched InDesign training in the world.
You can find more about David at 63p.com

Follow on LinkedIn here
  • Mike Witherell says:

    Oh, that is just what was needed! Thanks David, and a big thanks to Peter Kahrel!

    I noticed in playing with paragraph borders that the corners don’t align if the horizontal and vertical strokes aren’t all the same thickness. Anyone else notice that?

    • David Blatner says:

      Mike: No, I haven’t seen that. I have seen some strangeness in screen drawing based on the GPU… but it often goes away when I choose View > Preview on CPU, so I know it’s not “real”

  • Scott Citron says:

    Sweet script. Thanks David and big thanks, Peter!

  • Tobias Trofast says:

    Quick and efficient – great!

  • Chad Chelius says:

    Another reason why we need styles to be “aware” of other paragraphs. Another example is defining a style to not add space before if the previous paragraph has space after applied. This is a very similar problem with the paragraph borders.

  • Mari Gill says:

    What version did borders come in? I have CC 2017.1 but don’t have the borders option.

  • tonyt says:

    hope it works

  • >