Announcing Merge Text Extension for Adobe Illustrator

Following the release of my Combine Textfields extension for Flash, I’ve put together a similar extension for Adobe Illustrator. This extension installs a script that will merge text (including text on a path) into one text object, while retaining the style attributes of the individual pieces, including character styles as well as paragraph styles (if the separator includes a return character).

Anyone who’s tried to edit text from a PDF opened in Illustrator knows how frustrating it can be to make simple text edits when the text is broken up. This extension reduces that headache.

Special thanks to David Van Brink for posting the Omino Dialog Maker. His time-saving code was used to produce the dialog box in this extension.

Download Options

Installation Instructions

JSX or JS file:

  1. Place the MergeText_AI.jsx (or MergeText_AI_CS.js) into the Scripts directory within your Illustrator application directory:

Windows > C:\Program Files\Adobe\Adobe Illustrator {version}\Presets\en_US\Scripts
Mac OS X > Applications/Adobe Illustrator {version}/Presets/Scripts

Note: In CS4, the directory path will include a region directory (e.g. Adobe Illustrator CS4/Presets/en_US/Scripts).

MXP file or ZXP file (CS4 or newer):

  1. Double-click on the mxp file to install using Adobe Extension Manager.

Note: Adobe has abandoned Adobe Extension Manager as of CC 2015, even though it’s still installed. You can use the JSX file in that case (installation instructions above).

Update Oct. 2023

You also can try using one of these non-Adobe-built Extension Managers to install the .zxp file.

Usage

In Adobe Illustrator, select the text the you want to merge together and go to File > Scripts > MergeText_AI. If you’re using Illustrator CS3 or CS4, you will be prompted with a dialog box where you can choose your sorting orientation and a custom separator. If you’re using a version earlier than CS3, you will not be prompted with a dialog; the script will run using the default settings sorting topmost, then leftmost, with a separator of “[><]”. You can then run a Find and Replace and replace the separator with the characters of your choice.

Get updates from Ajar Productions

Sign up today and get the InDesign Split Text premium extension for free!

Unsubscribe at any time. Powered by ConvertKit

Join the Conversation

  1. Niklas says:

    Wow!

    This is cool – sounds very useful!

    Niklas

  2. Andy Jones says:

    Thanks. this will save me hours and hours.

  3. Justin says:

    Glad to hear it, Andy!

  4. Jr. Perez says:

    Thanks, you make my work so easily

  5. kath says:

    I have just tried this in CS2, and when the text strings are merged into one line, the tag [><] is inserted between the two entries.

  6. Justin says:

    Kath, this is described in “Usage” above. CS2 doesn’t support the dialog code, so the default separator is used. You can then use find-and-replace to replace the tag with your desired separator.

  7. Matt Rennick says:

    This is awesome – thanks!
    Have you noted any trouble with spaces? If I bring a PDF into illustrator that has text broken up character by character and merge it, all spaces are removed. Is there a workaround that you’re aware of at all?

  8. Matt Rennick says:

    Never mind… stupid question. If the characters are separated individually when the PDF is brought into illustrator – how could the program be expected to know where the spaces are supposed to go?

  9. Justin says:

    Matt,
    One technique that you can use in this case: combine the letters of the first word with no spaces, then the second word, then combine the two words with a space separator, and so on. Or combine the letters of each word, then the whole block of text with a space separator. Still tedious I know, but it beats doing entirely it by hand.

  10. JD says:

    Hello,

    Thanks very much for creating this script. I am using Adobe Illustrator CS3, and I am working with a lot of legacy information which comes with text with individual lines and even individual characters.

    Initially in the download, I noticed it opens up a web page with the program in text; so, I had to copy and paste to a text file (notepad) and rename the extension to .jsx. Then, AI didn’t recognize it initially until I exitted AI and restarted.

    I am able to merge two text strings together with this command.

    Question: since I am relatively new to AI usage.. How do I convert this text object of individual lines into a “text box” so that the text will wrap within the box? When I stretch the box of text, it stretches the letters (and changes the aspect ratio of the text) which I don’t want. I need the text to word wrap within the box and keep the text size the same.

    I am hoping there is a simple answer to this question. I tried the help menus with no luck. Perhaps, there is another script out there. This one is a good start though.

    Thanks,

    JD

  11. Justin says:

    JD,
    In the future, you should be able to right-click (ctrl-click on Mac) and choose Save Link As… Hopefully, that will save you some trouble when downloading scripts.

    Regarding the stretched letters. You can create a new text area by dragging a rectangle with the text tool and pasting your text in, or, you can just run this new script that I wrote:
    Convert to Text Area.

    Hopefully that will make life a little easier.

  12. JD says:

    Justin,

    Thanks again, your script works great.

    All,

    In regards to the merge text script, I was experiencing some issues selecting some text to merge. I would select 2 text entities to merge and it would tell me that no text entities were selected. This seems to happen to some pieces of text and not to others.

    In experimenting with it a bit, I have found that layering structure affects them. If I move some of the text out from lower level layers into higher ones, I can then select and merge them together. I am not exactly sure of the exact dynamics here.

    Does anyone understand the limitation of Merge Text as it relates to layers?

    JD

  13. JD says:

    Upon further experimentation, it appears that it doesn’t like it when you select text objects from different layer groups or layer group levels, and it doesn’t like it when you select the only 2 text objects within a layer group. A little rearrangement of the layer structure so that they are all on the same level seems to solve the issue.

    JD

  14. Justin says:

    JD,
    I ran some tests to be sure. The script doesn’t really care about the stacking order of the text layers, just grouping. If your objects are grouped, it will be recognized as a group, rather than text object(s).
    I did notice that the script runs a little quirky in group isolation mode. The problem occurs when you select all of the items within group isolation mode. Ideally, you’ll want to make sure that your text is ungrouped before you run the script. When I get some time, I may look into this issue and see if it can be fixed.

  15. Props to this super handy Adobe Illustrator script which just saved me hours of work: http://is.gd/lSvN

  16. Leanne says:

    Thanks for this script. It’s handy for sure.

    For Aussies who need to install this script to CS4 Illustrator, download the .jsx file, put in the en_GB folder instead of en_US because the Extension Manager automatically installs into en_US which Aussie version of CS4 doesn’t use but the installation will be successful.

    Took me a little while to figure out what was wrong. There you go.

    Thanks once again.

  17. ciprian says:

    Man! You really are a genius!! Thank you sooooo much! Be blessed!

  18. Hi,

    Thanks for the information,just found this post my technorati news feed section! I was searching for this since past 3 months and i am glad to see it here. Thanking you much

    Martin

  19. Wow,
    What a nice post,i just found this post story from my technorati profile news feeds section! I was searching for this since past 3 months and i am glad to see it here. Thanking you much

    Kathe

  20. Aaron Wall says:

    Great helpful information, Thanks for this nice post, just subscribed your feed, hope you will update new post soon.
    keep it up.

    Aaron.

  21. Hi,

    Thanks for this nice post, i have found this post Url from my Newswine account recent news options,just subscribed your feed, hope you will update new post soon.
    keep it up.

    Michael

  22. Excellent Post, i have found this post Url from my Newswine account recent news options,just subscribed your feed, hope you will update new post soon.
    keep it up.

    Jenni.

  23. josh says:

    Hi,

    thanks for this amazing script. i work with a lot of diagrams that need to be pasted into illustrator. the diagrams usually have hundreds of variable names, with each variable name being split into multiple text boxes. this script allowed me to merge those boxes so that each variable name is now a single text box.

    however, the diagram has hundreds of these variables, so merging each of these individually still takes quite some time, and selecting all text, then merging, would make one massive text box w/ all variable names, which is not what i’m looking for. is there an easy way to edit this script so that it can find each grouping of words (which would consitute a single variable), and run merges for all of them?

    merging hundreds of times all at one go would be amazing and save me countless hours.

    thanks!

    1. Justin says:

      Josh,
      Sounds interesting. I’ve never worked with variables in Illustrator before. Can you post a sample file with some instructions? I can take a look and try to put together a script.

  24. josh says:

    http://dl.getdropbox.com/u/260/diagram.ai

    Hi Justin,

    Thanks for looking into this! The file contains something called a Causal Loop Diagram, something used for System Dynamics analysis. These diagrams usually carry a number of variables (this sample has fewer)

    These variable names are simply text, but because each variable name is usually made up of 2-4 lines, each variable name is made up of 2-4 text boxes when pasted into illustrator. Your merge tool seamlessly merges these names into single text boxes, but the merge script needs to be run individually for each and every variable name.

    Can you think of a way to have every single “grouping of words” be merged into single text boxes by running a script only once?

    thanks! again, we are very grateful for your script and are using it even when we run it for each variable; it STILL saves us time =)

  25. Edward says:

    Hello,

    Is there a way to merge text layers while keeping their format intact? Of course keeping the text editable at the same time. This script is very useful but it seems to still justify the type requiring one to re-layout and format. I have pages and pages of files that I need to condense with layers of 500 and above. I will then export them to a layered PSD format and bring them into After Effects. Have any ideas? Thank you for this great script and any input you can provide for my dilemma.

    Sincerely,
    Edward

  26. Justin says:

    Hi Edward,
    This script will maintain the text format and a lot of the paragraph formatting, but maintaining indents or spacing relative to the artboard is another beast entirely.

    As far as merging layers goes, you can select the layers, then select “merge selected” from the layers panel fly-out menu. That won’t merge the text into one textfield, but it will get everything on one layer. Getting the text into one textfield and keeping the spacing between the original textfields is much more difficult to do.

  27. Justin says:

    Josh,
    I think what you’re asking can be done. I’m still planning to get back to you, just need to get a window of time.

  28. TLMurray says:

    I have a suggestion for a similar, and perhaps easier, extension. For those (for example) PDFs that when opened in Illustrator consist of each character being a separate text object, I would like to have the text assembled into strings, but I don’t care a darn about maintaining fonts.

    1. Justin says:

      TLMurray, this extension should accomplish that as well. Where do you find it wanting in this regard?

  29. For anyone who’s ever tried to edit text from a PDF opened in Illustrator http://bit.ly/lbFQT

  30. Merge multiple/broken text boxes in Illustrator with a super simple fix: http://tinyurl.com/6jrt28

  31. TLMurray says:

    Regarding not “caring a darn about maintaining fonts”, if the result were like your illustration at the top of this page, then a simple “select all” and setting to the same face is the same thing.

    Now, I’m not finding a way out of that “you must select more than one text field” issue. I have a three-line sample at http://public.me.com/tlmurray. No matter how I select the three lines, I can’t combine them.

  32. Justin says:

    TLMurray, toggle open your “Layer 1” in the layers panel. Two of your textfields are actually within groups (notice the sublayers are named ““). If you select all, ungroup (ctl + shift + g on Win & cmd + shift + g on Mac), then run the script, it works just fine. The interface is slightly deceptive because it will let you edit them as if they are plain textfields.

  33. Justin says:

    Josh, Sorry for the long delay. Here’s a modification of the script that will merge by variable name: MergeTextByVariable.jsx.

  34. shaun says:

    This script has just made my day, month and year. Fantastic!

  35. Justin says:

    That’s great to hear, Shawn!

  36. LinZ says:

    your so cool thanks a ton a real life saver 🙂

  37. Stumbled on exactly what I was looking for after hours of searching. Thanks for sharing.

  38. Nick Stanley says:

    WOW!!! THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU! Seriously. You have no idea how happy I am right now about this script. You are awesome…what else do you have on this SITE!?!?!?!

    *Starts Browsing*

  39. Justin says:

    Glad to hear it, Nick!

  40. Picto says:

    First of, great script! and its a super timesaver 🙂

    but I just upgraded to CS5 and it’s not showing up in the script folder:( anyone know how o fix it?

  41. Picto says:

    Doh! Figured it out, it created a new language folder called US while my default script folder is UK, a quick “copy and paste” fixed the problem.

    Once again, nice script 🙂

  42. zOnk.oNe says:

    Nice. This just made my life a little easier.

    Big Thanks 🙂

  43. Justin says:

    Great to hear it, zOnk.oNe!

  44. Nice script! thanks so much.

    Jesse

Leave a comment

Your email address will not be published. Required fields are marked *