Speeech!
January 27, 2012 | Snippets | en | fr

Speeech.js for InDesign CS4 and CS5+ 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.
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.
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
In particular, resetting the CURVE parameter to 0 (zero) lets you get straight pointers, while increasing that value produce more pronounced curves:

Comments
Comme tu le dis, Trop fort !
Héhé marrant ce truc. Tu es toujours là où on t'attend pas :D
Loic
Ce script est peut-être "rudimentaire", mais il va m'être bien utile.
Parfois je dois "interpeller" le lecteur au moyen d'un phylactère. Ma plus grande difficulté était de dessiner le pointeur. Ceux que je produisais ne me convenaient jamais... et y passait trop de temps pour y parvenir.
En plus, je trouve très astucieux le placement de cette pointe. :)
Hello again - I am the user who proposed the idea... I used to make this manually, by creating one text frame (ussually oval) and the duplicating a piece of triangle drawn just the way I liked it: a bit curved and rotating and scalling until I got the result I wanted. After that I would join the two paths. Your solution is outstanding, thank you again... I owe you big...
Excellent Marc !
La simplicité n'est ici que le symptôme visible de la maîtrise :)
C'est Magnifique!
how do you actually run this on a mac? I tried to download it but it just opened to another browser page with the script, and copying and pasting in applescript editor window didnt work.
this is the first time i am using a script! please help.
Hi ANIA,
> this is the first time i am using a script! please help.
Let me direct you to this excellent resource for beginners (designed by Dan Rodney): “How to install InDesign/InCopy Scripts”
See also this useful page at InDesign Secrets: “How to Install a Script in InDesign That You Found in a Forum or Blog Post”
@+
Marc
@Anina: hold down the alt key before clicking the link. This will then download the file into your downloads folder.
Nice script - thanks!
Bon, c'est pas le tout de jouer Marc, on attend des scripts sérieux…!! J'déconne, excellente idée et pas si farfelue…!!!
NB : tu devrais prendre plus souvent des vacances, ça te réussit ;^)