Mailing List AE-List@media-motion.tv ? Message #51010
From: Phil Spitler <phil@bonfirelabs.com>
Subject: Re: [AE] Automating line breaks or batch convert to paragraphs
Date: Tue, 1 Oct 2013 12:26:37 -0700
To: After Effects Mail List <AE-List@media-motion.tv>
Ok, I just whipped up this expression that will do the trick.

Create a new null layer called "control" and add a slider, this will tell the text how many characters there are before it splits the line.

Apply the following expression to the source text of your text layer. You can also then copy the expression and paste it to all your text layers.



txt = text.sourceText;
newTxt = "";
split = 0;
splitVal = thisComp.layer("control").effect("Slider Control")("Slider");
for (i=0; i < txt.length; i++) {
newTxt = newTxt + txt[i] 
split++;
if (split == splitVal) {
split = 0 ;
newTxt = newTxt +"\r";
}
}

newTxt



I just tested it and it works great, my coding is not the most efficient I'm sure but it does work.

Sample project is here.



Phil





signature1 Phil Spitler  |  Creative Technologist   |  Bonfire Labs  |  t : 415.394.8200  m : 415.571.3139

Website | Facebook | LinkedIn

On Oct 1, 2013, at 12:00 PM, Louai Abu-Osba wrote:

That's a toughy. Maybe you could have a script run through each layer and add line breaks every x number of characters?


On Tue, Oct 1, 2013 at 12:54 AM, Chris Zwar <chris@chriszwar.com> wrote:
Hi,

I'm having a total brain freeze and could do with some advice.
I have several hundred text layers that are currently single lines of point text.  I need to add line breaks to each of them  so they will fit into a column, each line will probably be split over 5-6 separate lines.

So:

1) Is there a way to batch convert point text layers to paragraph text layers and give them all the same bounding box

or

2) Is there a animation preset I can use to automatically add line breaks at the nearest word after every x characters?

Cheers,


-Chris



+---End of message---+
To unsubscribe send any message to <ae-list-off@media-motion.tv>


 
Subscribe (FEED) Subscribe (DIGEST) Subscribe (INDEX) Unsubscribe Mail to ListMaster