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:
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.
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.
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.
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.
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.
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).
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.)
Consider making a donation. To make a donation, please press the button below. This is Paypal's payment system; you don't need a Paypal account to use it: you can use several types/brands of credit and debit card.
Click to show script -- to download, right click, then Save Link/Target A
Installing and running scripts
Questions, comments? Get in touch