Javascript Adobe Illustrator

When you open in Illustrator a PDF file generated from InDesign or QuarkXPress, you certainly noticed that the paragraphs are always split into several text frames, at least one for each text line but often you even see multiple contiguous text frames on the same line. If you do not have available the source file and you want to be able to edit the text from the PDF using Illustator, it is more convenient to have one single text frame with several lines, where you can then insert or delete words or whole lines, modify the leading, alignment, kerning, tracking, etc.

As i promised you in my first article "Fit a text to an outline", here is a script that will enable you to merge text parts together to get multi-line text frames.

aiSomeone provided you with a file (such as ai, pdf, eps) and you are now asked to edit a text line in it using Illustrator, but unfortunately this text has been converted to outlines sad


If you have ever been through this before, you know that you have to cope with some difficulties to get to it : identify the font, get it (legally !) and load it, if this font is not already in your system or font manager, and finally recreate the text with exactly the same typeface size and horizontal scale.
This simple script without any dialog box nor option will help you to accomplish the last step by enabling you to fit exactly the text to the bounds of a vector object. For example you type and format with the needed font the first letter of the text you want to recreate, you select both the text and the corresponding outline and the script fits the text to the outline.

ajuster le texte au trace ai015 2

If you actually used the same font as the original, you will be able to check by zooming in up to 6400% the perfect superposition of the character on the outline, if not — this generally means that you didn't use exactly the same font version (for example you will never succeed to fit the Adobe Futura to your outline if the font originally used was Futura BT).

If the whole line has the same character attributes (same font, same weight, same typeface size, etc.) all you have to do now is to type the other letters and modify if needed the kerning method and letter/word spacing to get a satisfying superposition of the whole recreated text line on the reference outline. The script can also fit a text including several characters to a selection of several vector objects, but the result will not be satisfying if the kerning and justification are not appropriate. If you have several fonts and styles in the same line, then you will have to recreate it in several parts that you will be able to merge using this other script or a similar script that i wrote myself, that should give better results and that i will also upload soon [PS: a promise made is a debt unpaid].

Tested from CS5 to CC2015.

Note: the script is intended for outlines converted from horizontal text, possibly extended or condensed, but not rotated nor deformed such as sheared to make false italic. In the case of simple rotation if you manage to estimate the rotation angle of the vector object you should get a correct result if you apply the same rotation to the text sample before launching the script, in the case of skewing, the angle is excessively complex to estimate if the deformation was combined with a non-uniform scale (extended or condensed).

ai It's so easy to convert an anchor point from angle to rounded and back. An alt clic on your point makes an agled one, an alt clic and drag switches to rounded.

But what if you have a lot of points to handle....? Are you seriuously thinking about clicking hours and hours ? What abour using this script ?



Select points to convert to rounded and then launch the script.


aiHere are two Illustrator scripts for working on paths.

  • The first one closes all the selected open paths (or all open paths if there is no selection).
  • The second one quickly changes the orientation of one or multiple paths. Interesting if you want to add a shape to that path and need a change in the path direction.



closePath fr

  • If you have selected open paths, these one only will be closed. On the contrary, any open path will be proceeded.
  • Run the script…



  • Select the paths you want to change the direction
  • Run the script…

The scripts are available in three languages (english, french and deutsch). Before the first use, you have to set the script speaking language.
To do so, you have to edit the javascript file. Have a look on the included README.txt for the instructions.



feed-image Follow

Scriptopedia sur facebook


An original idea from Loic Aigon, designed by Eddy.VH. It 's a scripts library for Desktop Publishing Adobe products. Find Javascript for Photoshop, Illustrator, inDesign and Acrobat or ATN scripts ( Photoshop actions ) you need.