Fix Paragraph Leading

There’s a relatively common problem where the last line of a paragraph can get inexplicably spaced differently than the rest of the paragraph. For a full explanation please refer to this great post on InDesign Secrets.

We wrote this simple script to fix the cause for these “rogue line spacings”. Basically, what the script does is makes the leading of the paragraph return equal to the text before it.

You can get the script here.

Tags: , , ,

6 Comments

  1. Vinny Ryder says:

    Hi there

    I’ve just recently discovered this site and this has been the first script I’ve downloaded. Just want to say thanks for all the effort that’s been put into this and it really is an excellent resource.
    My question: Is there a way to have the script “auto apply” itself to all paragraphs in InDesign, so that I wouldn’t actually have to go into the scripts panel and run the script?

    • Harbs says:

      No. Scripts do not work dynamically.

      You can create a keyboard shortcut to invoke scripts so you do not need to use the Scripts Panel to launch them.

  2. Lauren says:

    Does this not work for CS 5.5?
    I’m getting:

    Error Number: 45
    Error String: Object is invalid

    Engine: main
    File: C:\Program Files\Adobe\Adobe InDesign CS5/5\Scripts\Scripts Panel\Laurens Scripts\FixParaLeading.jsx
    Line: 8
    Source: myPara.characters[-1].pointSize = myPara.characters[-2].pointSize;

  3. Leslie says:

    Hi,

    When I run this script I get a java script error. The error message was:
    error 45 “Object is Invalid.” I am using InDesign CS 6 on Mac OS 10.7.5

    I installed the script in the scripts panel under javascript. What did I do wrong? I have tried deleting and reinstalling but get the same error again.

    Thanks for your help.

  4. Keith says:

    InDesign Secrets explains well why this happens. The second paragraph in your description above says “rouge line spacings.” But I think the word you’re looking for is “rogue.” As written, the line spacings would have a reddish hue.

  5. Harbs says:

    Nice catch. Fixed the typo.
    Thanks!

Leave feedback