Site logo

This page is under construction

Cutoff rule

This script creates vertical and horizontal lines separating columns of text, between objects like pictures, ads, etc.

This script reads parameters from the Cutoff rule.txt file and applies them depending on the object style applied to the selected frame. The file contains one or more objects enclosed in curly braces (1) and separated by commas. For example, if the ‘title’ object style is applied to the selected text frame, the set of parameters whose objStyle (2) is the same — ‘title’ — will be used.

groupObjectWithLine (3) — true/false — group the created line(s) with the selected frame(s).

Inside the style’s object, there are horizontal (4) and vertical (5) objects that contain parameters (also enclosed in curly braces) for, respectively, horizontal and vertical lines which have three settings for shifting lines that use the same system of coordinates as InDesign: positive values move to the right/downwards and negative to the left/upwards.

horizontal

vertical (6) — shifts a horizontal line vertically
left (7) — shifts the left end of a horizontal line horizontally
right (8) — shifts the right end of a horizontal line horizontally

vertical

horizontal (9) — shifts a vertical line horizontally
top (10) — the top end of a vertical line vertically
bottom (11) — the bottom end of a vertical line vertically

 

For example, let’s take the settings on the screenshot above. With a title text frame selected, the created horizontal line will be moved by 15 points to the top (negative value) and the vertical line.

All the job is done by the main script — Cutoff rule.jsx — which is triggered by two other small scripts using the doScript() command which sends the only argument: which is the file name itself (without extension) either Vertical or Horizontal.
All three scripts and the Cutoff rule.txt file should be located in the same folder.

Click here to download the script.