3 Replies Latest reply on Jul 8, 2013 8:42 AM by Glynn.Alexander

    Split Text into Layers


      I was wondering if anyone is aware of a script that is able to do the same as this photoshop one http://www.agasyanc.ru/text-splitter, I would use that one in photoshop but its not working in CS6.


      I  was hoping to find a script that will seperate the text into layers  ready for export to After Effects to be used in Kinetic Typography  pieces


      thank you

        • 1. Re: Split Text into Layers
          Gustavo Del Vechio Level 3

          So what you want is to separate each word of a text into a separated layer.


          Well, do not know any script to do it. Not so easy, but it does not mean it´s impossible to write one. Perhaps the difficult you will have is to get the words in the same artboard´s position. Also, you must know text located in contents like symbols are not able to be acessed by JavaScript. So, if the text is an isolated object or inside single groups, it´s easier to read via script. 


          You can find more informations about scripting in Illustrator in the manual: http://www.adobe.com/devnet/illustrator/scripting.html


          If you have any difficult writting, you could post here and I can help you.


          Best Regards



          • 2. Re: Split Text into Layers
            W_J_T Level 4

            You could try using the PhotoShop script you posted, then bring things into Illustrator from PhotoShop.

            Importing artwork from Photoshop

            http://help.adobe.com/en_US/illustrator/cs/using/WS714a382cdf7d304e7e07d0100196cbc5f-6566a .html


            Illustrator supports most Photoshop data, including layer comps, layers, editable text, and paths. This means that you can transfer files between Photoshop and Illustrator without losing the ability to edit the artwork.


            That could be one possible no so elegant alternative, maybe see if it works for your needs.

            • 3. Re: Split Text into Layers
              Glynn.Alexander Level 1

              thanks, got the script I found working in photoshop with an edit or two as it was not working within macs


              would love to get it working in illustrator though, must be the same basic principles.


              doc = app.activeDocument;

              layer = doc.activeLayer;


              var text = layer.textItem.contents;

              var textArray = text.split(" ") || text.split("/r");


              var pos = layer.textItem.position;

              var leading = 0;


              try { layer.textItem.leading; } catch (e) { layer.textItem.useAutoLeading = true; }


              if (layer.textItem.useAutoLeading){

                      leading = layer.textItem.size/100*Math.round(layer.textItem.autoLeadingAmount)




                  leading = Number(layer.textItem.leading)





              layer.name = textArray[0]

              for (var k=1; k<textArray.length;k++){

                  tmp = layer.duplicate();

                  tmp.textItem.position = [pos[0], pos[1]+(Number(leading)*k)]

                  tmp.textItem.contents = textArray[k];