Announcing Merge Text Extension for Adobe Illustrator

Justin | design,ExtendScript,extensions,Illustrator | Sunday, November 23rd, 2008

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 (CS4 only):

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

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.

Related Articles

96 thoughts on “Announcing Merge Text Extension for Adobe Illustrator”

  1. Luis says:

    Thanks for this brother! will it work in cs5?

  2. Justin says:

    Hi Luis, it should work just fine in CS5, but you may have to alter the installation directory.

  3. Devon says:

    I get an error message:
    Error 24: newOminoDialog is not a function.
    Line:68
    -> var omd = newOminoDialog(“Merge Textfields”);

    What am I doing wrong? I have a Mac and AI CS4.

  4. Justin says:

    Hi Devon,
    It looks like you’re trying to run the CS1 file in CS4. Download the JSX file or the MXP file above. Either one of those should work fine.

  5. waterionizer says:

    Thanks very much for creating this script.

  6. Herrhumi says:

    Great script! thansk so much!

  7. jimmy says:

    Love it! your just made my evening a lot easier!!

  8. Justin says:

    Glad to hear it! Thanks for the comments, Jimmy and Herrhumi!

  9. Daniel says:

    I am using this in CS5 PC, and when I select the text and try to merge, I get a Script Alert message that says “No textfield selected”. Anyone know why or how to fix? Thanks!

  10. Justin says:

    Hi Daniel,
    Are the textfields locked in any way?

    Is anyone else having this issue?

  11. Claudio says:

    Gracias, excelente desarrollo, no saben cuanto me ayudara!!!

    Genios!!!

    Saludos desde Chile

  12. Justin says:

    Gracias, Claudio!

  13. Dylan says:

    Amazing. What a life saver. Thank you!!!

  14. Justin says:

    Glad to hear it, Dylan! Thanks for your comment.

  15. Kiran Ahire says:

    Hi,

    Very very useful script. Thanks lot.

  16. Jules says:

    THRILLING!!! You just saved me a TON of time. Thank you x a mil.

  17. Justin says:

    Awesome! Glad to hear it, Jules!

  18. Amy says:

    Hi,

    I’m very excited about this product, but I’m running into some issues. It’s working for some text boxes, but for most it gives me the following error:

    JavaScrit Error!

    Error Number: 30614
    Error String: Invalid object for this request.

    (then gives the file location, etc)

    I’ve double checked that I am only selecting text boxes, and still no-go. Any suggestions?
    If it makes any difference, I used PDF2ID to convert this from a PDF, and as you may or may not know, it converts the file into all separated text boxes. I’d love to get around this somehow!
    Thanks!

  19. Justin says:

    Hi Amy,
    I’d be happy to look at this issue. Can you post line number and source that are given when the error occurs?

    Also, let me know which version of AI you’re using. If you can post a copy of the file that would be helpful, too.

  20. Amy says:

    Well, you’re not going to believe this, but since I was messing around with the settings on my PDF2ID, I figured I should re-run the file to give you a fresh one. Guess what- all the paragraphs came in in single text boxes! The sad part is I have NO idea what setting I changed in PDF2ID, but whatever it was, it fixed my issue. Whew. Thanks so much for your prompt response though… I’ll certainly let you know if I run into this issue again!

    p.s. tried your Illustrator one and it works wonderfully- thank you!

  21. KO says:

    yeeeeeee just saved me a bunch of time! Thanks!!!

  22. J says:

    the script does not show up in the menu File > Scripts. it says it’s installed in adobe extension manager, what am i doing wrong?

  23. Justin says:

    Thanks for the comment, KO!

    Hi J, my best guess is that the version of Extension Manager does not match the version of Illustrator that you’re using. Do you have multiple versions of CS applications installed?

  24. HP says:

    cool!

    it runs with the german illu cs5.1, when i move the file from

    C:\Program Files (x86)\Adobe\Adobe Illustrator CS5.1\Presets\en_US\Scripts

    to

    C:\Program Files (x86)\Adobe\Adobe Illustrator CS5.1\Presets\de_DE\Skripten

    thank you!

  25. Justin says:

    Glad to hear it, HP. Thanks for sharing!

  26. LSE says:

    Thanks so much for this script! It’s just what I needed.

  27. Justin says:

    Awesome! Thanks for the comment, LSE!

  28. Dan says:

    WOW! [><] WOW!!! Awesome Justin! Saved me a ton of time! Thank You… -Dan

  29. Justin says:

    Great! Glad to hear it, Dan!

  30. Diana says:

    I can’t wait to use this! I have run into this very problem hundreds of times. Unfortunately after I downloaded the MergeText_AI_en.mxp (CS4 & up – US English) and attempted to use it in my illustrator CS5 I received this error.

    Error22:Window does not have a
    constructor.
    Line: 341
    -> var oD = new
    Window(‘dialog’,name,[100,100,500,500]);

    Thanks in advance!

  31. Justin says:

    Hi Diana,
    This error may be a result of a corrupt preferences file on your system. To reset the preferences in Illustrator: Hold down Shift+Ctrl+Alt (Win) / Shift+Command+Option (Mac) when you start up Illustrator. Hopefully that should resolve the issue.

  32. Oh, wow. Needed art and copy and only had a PDF from the other designer …. didn’t get the .AI file …. This PDF opened particularly messy when brought back to AI and it was going to take me all night to re-join the copy. You saved me hours! Thank you!

  33. Justin says:

    Awesome, James! Glad to hear it!

  34. Justin, thanks so much for this script. Definitely helps.

    Would you know of a way to rejoin text that has been broken into individual letters, each letter being a path (apparently). I’m new to AI and have received this file from a designer where almost every text is broken up into individual letter, for reasons I can’t quite fathom. However, that makes it impossible to manipulate the text, unless I recreate a text object looking the same (which means I have to guess the font, size etc.)

    Here’s a screenshot.

    http://screencast.com/t/xYHOIY02HxSO

  35. Justin says:

    Hi Dan, glad to hear that the script helps!

    Unfortunately, once the text is converted to outlines, there isn’t a good way to get it back.

    Here’s one (admittedly convoluted) idea. Use OCR in Acrobat to recognize the text (in my version it’s found under View > Tools > Recognize Text). You may need to export from AI to high-res (300+ dpi) bitmap for this to work. You can then paste the text into Illustrator.

    Then use WhatTheFont to determine which fonts were used.

    This might save you some time for large documents.

  36. kate says:

    THANK YOU !!! after trying SO many different things, this FINALLY worked!!! it was so much text and i tried it all at once to see if the script could handle it… it stop responding for a little while, but then i walked away for a couple minutes and came back to a fully formed paragraph that was once 5,200 separate characters. THANK YOU!!!

  37. Justin says:

    Hi Kate,

    So glad it was helpful! Thanks for your comment.

  38. Gio says:

    Thanks a lot for this. I had it installed on my computer at work some years ago, then I switched jobs and could not it again. But I finally did!!!!

    Thanks for assisting me with crappy clients :-)

  39. Justin says:

    Hi Gio, Glad you re-discovered our script! Happy to assist you!

  40. Ekon says:

    Worked like a charm!

    Thanks a lot ;)

  41. Justin says:

    Glad to hear it, Ekon!

  42. Greg says:

    I have loved this extension ever since it first saved the day for me….but now I cant get it to install with the new CC version…such a great tool hope there is a CC update soon?

  43. Justin says:

    Hi Greg,
    I haven’t tested this in CC yet, but you can try changing the file extension from mxp to zxp. It should then install with Extension Manager CC.

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>