Fine-Tune Paragraph Spacing

Six scripts, ideally triggered by keyboard shortcuts, to increase or decrease the selected paragraph's spacing by 1 point.

This script is part of the Type and Text collection. See the full collection here

To make and balance pages—that is, to make sure that the text fills the text area on a page precisely and that facing pages and/or columns are equally deep—the space before certain defined paragraphs (headings, block quotes and other secondary material, etc.) can be varied a bit by adding or removing up to 3 points.

Another requirement could be to set half a line of white before or after certain text elements, but that space can’t be set in a paragraph style.

Space before and (less commonly) after can be manipulated in the Paragraph panel, but that’s cumbersome. When you’re making pages, what you want is to use the keyboard. We’ll show six scripts here which, when assigned to keyboard shortcuts, do just that.

The six scripts are in the linked zip file, below. They are in two groups: three scripts to change the space before the selected paragraph, and three others to target the selected paragraph’s space after.

  • pspace-before-6.jsx Add half a line of white before the selected paragraph. The script calculates this on the basis of the selected paragraph’s leading. It handles paragraphs with fixed and with automatic leading.
  • pspace-before-inc.jsx Increase the selected paragraph’s space-before by 1 point.
  • pspace-before-dec.jsx Reduce the selected paragraph’s space-before by 1 point.
  • pspace-after-6.jsx Add half a line of white after the selected paragraph.
  • pspace-after-dec.jsx Reduce the selected paragraph’s space-after by 1 point.
  • pspace-after-inc.jsx Increase the selected par’s space-after by 1 point.

Copy these six scripts to your Scripts folder, then set up keyboard shortcuts in the keyboard shortcuts editor (Edit > Keyboard shortcuts).

The way I set them up is as follows:

  • pspace-before-6.jsx F1
  • pspace-before-inc.jsx Shift+F1
  • pspace-before-dec.jsx Crtl+F1
  • pspace-after-6.jsx F2
  • pspace-after-inc.jsx Shift+F2
  • pspace-after-dec.jsx Ctrl+F2

You can use any key combination you want, but the way I configured them allows me to press them with one hand.


Version history

These are fairly old scripts, but refreshed and first posted in June 2023.

Peter Kahrel Script Repository
Hosted as a community service, and with deep appreciation, by CreativePro.com


Scripts by Topic | Script Index
Basic Script Installation and Use
How to Modify or Configure These Scripts
Resources for Scripting and Publishing Automation
About This Repository


Contact Peter Kahrel


Note to users: You run scripts at your own risk: CreativePro and the author accept no liability for anything that may be caused by any of these scripts. Always take the necessary precautions. We encourage you to save backups and test scripts on copies of your documents.

Bookmark
Please login to bookmark Close

This article was last modified on August 22, 2026

Comments (0)

Leave a Reply

Your email address will not be published. Required fields are marked *

Loading comments...