Vertical Rules (Pre-CC2017)

You can define horizontal rules (one before, one after) in InDesign's paragraphs, but for years, you could not do so with vertical rules. The script fixes that.

InDesign CC2017 introduced the Paragraph Borders and Shading dialog box, which obviates the need for this workaround.

This script is obsolete and largely available for historical purposes. See the full collection of scripts for older InDesign versions here.ย 

The script adds vertical rules to selected paragraphs. Of the several methods suggested in a thread onย Adobe’s InDesign forumย — paragraph rule, dropcap on pipe symbol, placing paragraphs in a table cell, graphic rule in an anchored frame — the latter seemed the most flexible and manageable.

The script works on selected paragraphs and on text frames. It has no interface. To use it, select one or more paragraphs (no need to select whole paragraphs; a couple of characters in each will do) or a text frame and run the script. The screenshot shows the result on two selected paragraphs:

vertical paragraph rule -- default

The vertical rule is added as an anchored page item (or “inline”). It is inserted at the beginning of the paragraph (you can see the inline’s position as in the screenshot by displaying hidden characters: Type > Show Hidden Characters; the inline is the blue Yen symbol). The script defaults to a 0.75 point rule set off 6 points from the column edge; rules are drawn from the top of the ascender of the paragraph’s first line to the bottom of the descender of its last line. It is easy to change these defaults and other properties of the rules; see below.

Two restrictions

Like the other methods mentioned in the thread, adding vertical rules as inline graphic lines has two drawbacks. First, the rules are static. This means that if you change one or more paragraphs to which a rule has been added so that its number of lines changes, you need to run the script again. (When you do, existing rules in the selection are removed and a new one is added; no need to delete rules first.)

Secondly, again like the other methods, the rules can’t deal with paragraphs that break across frames. The script handles this by adding two rules in broken paragraphs: one rule at the beginning of the first selected paragraph (the first circled anchor in the screenshot below), another rule at the beginning of the next text frame, extending down to the last line of the last selected paragraph.

Vertical paragraph rules

This second rule is added in the first line of the text frame, at the end of the middle word. This is not ideal, but there aren’t any real alternatives.

Changing the rules

As mentioned earlier, the rules are static. Though they run along with paragraphs when text changes before ruled paragraphs, the moment a ruled paragraph breaks differently across frames you need to run the script again. Vertical rules inserted by the script earlier are removed. Any other rules are left alone.

Changing the appearance of rules

The script creates an object style with the name vertical_rule___. Edit this style in the Object Style Options dialog to change any property of the rule (Window > Object Styles, right-click the style and pick Edit “vertical_rule___”).

In the Object Style Options dialog, the properties of rules can be modified in two areas. The first is the appearance: weight, colour, tint, etc. To change any of these, click Stroke under Basic Attributes; the screenshot shows where you change these properties.

Edit vertical rules object style

To change aspects of the position of vertical paragraph rules, click Anchored Object Options in the same list under Basic Attributes (see the next screenshot). The position of vertical rules relative to the anchor’s text frame (its offset) is set at X_Offset (circled red in the screenshot).

Vertical rules object style anchored settings

The offset is the distance between the right-hand side of the rule and the left-hand side of the column. (At Y Relative To you can select the alignment of the top of the rule: cap height, top of leading, and baseline. The field is empty here because the script sets the vertical position to the font’s ascender height. Strangely, this option can’t be picked in the interface but you can set it in a script — which is why the field is empty.)


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


Repository Home Page


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...