July 27, 2015 | Snippets | en | fr

Speeech.js for InDesign CS4, CS5, CS6, and CC is a very basic script inspired by a recent forum topic: “Drawing a triangle shape thru a script…”. The user was “looking for a way to automate some of the work [he does] for a manga magazine...” Given a dialog in an oval shape already formatted, he wanted to specify the place where the oval should point and have the speech balloon automatically created.

Update 27-July-2015. — Slight bug fix, thanks to Bruno Herfst.

Speeech provides two alternative ways to easily achieve this task:

1) Click the Reference Point—in the Control panel—which corresponds to the direction of the pointer relative to the target object, then select the object and run the script.

2) Use the Line tool to draw a direction line, then select both the line and the target object and run the script.

Speeech Demo (script for InDesign)

Technical notes

— Speeech.js can be applied to any polygonal shape ( Oval , Rectangle , etc.), including customized paths. It also supports text frames.

— If needed, the script automatically computes the intersection point between the direction line and the target frame, so you don't have to position the exact junction point.

— Speeech.js supports rotated, scaled, and/or skewed shapes. It always considers the inner coordinate space of the target object.

— Advanced users can customize the Speeech effect by playing with the following parameters (see the source file):

// Distance between the 'attach' point // and each 'twin' point (in pt) ATTACH_WIDTH = 6 // Depth of the attach point within // the frame (in pt) DEPTH = 8 // Magnitude of the direction vectors // given as a barycentric factor ]0,1] DIR_WEIGHT = 0.5 // Curve factor (>=0) CURVE = 2