Quantcast
Channel: Adobe Community : Discussion List - After Effects Scripting
Viewing all articles
Browse latest Browse all 2143

Struggling to understand TextDocument (want to format text layer)

$
0
0

Hi everybody,

I've spent a ton of time trying to understand how textDocument works, but I just can't seem to wrap my mind around it.  

 

In the script I'm working on, I take text entered into an edittext box, then split it up by word, entering it into an array.  I add it to the comp, one word per layer.  I'd like to be able to pick the font size and color before it creates these layers. 

 

Here is the function that responds to a button click:

buttonCreate.onClick = function () {            var stringArray = myEditText.text.split(" ");            var stringArrayNumItems = stringArray.length;                       //Loop through stringArray words            for(i=0;i<stringArrayNumItems;i++) {                curComp.layers.addText(stringArray[i]);                           }                   }

 

So, I know I need to put that line that includes .addText in it into a variable.  I just don't know how to go through and edit its properties. 

 

Thanks!

-Justin


Viewing all articles
Browse latest Browse all 2143

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>