<p>I'm using the After Effects CS3 Javascript API to dynamically create and change text layers in a composition.</p>

<p>Or at least I'm trying to because I can't seem to find the right property to change to alter the actual text of the TextLayer object.</p>

[{'answer_id': 69462, 'author': 'dawnerd', 'author_id': 69503, 'author_profile': 'https://Stackoverflow.com/users/69503', 'pm_score': 2, 'selected': False, 'text': '<p>I\'m not an expert with After Effects, but I have messed around with it. I think <a href="http://library.creativecow.net/articles/ebberts_dan/ae6_exp.php" rel="nofollow noreferrer">reading this</a> might help you out.</p>\n'}, {'answer_id': 73071, 'author': 'Gareth Simpson', 'author_id': 147, 'author_profile': 'https://Stackoverflow.com/users/147', 'pm_score': 3, 'selected': True, 'text': '<p>Hmm, must read docs harder next time.</p>\n\n<pre><code>var theComposition = app.project.item(1);\nvar theTextLayer = theComposition.layers[1];\ntheTextLayer.property("Source Text").setValue("This text is from code");\n</code></pre>\n'}, {'answer_id': 28845462, 'author': 'Chris', 'author_id': 5073, 'author_profile': 'https://Stackoverflow.com/users/5073', 'pm_score': 1, 'selected': False, 'text': '<p>This is how I\'m changing the text.</p>\n\n<p><div class="snippet" data-lang="js" data-hide="false">\r\n<div class="snippet-code">\r\n<pre class="snippet-code-js lang-js prettyprint-override"><code>var comp = app.project.item(23);\r\nvar layer = comp.layer(\'some_layer_name\');\r\nvar textProp = layer.property("Source Text");\r\nvar textDocument = textProp.value;\r\n\r\ntextDocument.text = "This is the new text";\r\ntextProp.setValue(textDocument);</code></pre>\r\n</div>\r\n</div>\r\n</p>\n'}, {'answer_id': 59913842, 'author': 'Myzel394', 'author_id': 9878135, 'author_profile': 'https://Stackoverflow.com/users/9878135', 'pm_score': 0, 'selected': False, 'text': '<p>I wrote a simple function for myself to change properties. Here it is:</p>\n\n<pre><code>function change_prop(prop, name, value){\n    var doc = prop.value;\n\n    doc[name] = value;\n    prop.setValue(doc);\n\n    return prop;\n}\n</code></pre>\n\n<p>Example use:</p>\n\n<pre><code>// Changing source text\nchange_prop(text_layer.property("Source Text"), "text", "That\'s the source text");\n\n// Changing font size\nchange_prop(text_layer.property("ADBE Text Properties").property("ADBE Text Document"), "fontSize", 10)\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/69445', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/147/']