<p>Found it</p>
<pre><code>t=thisComp.layer(&quot;test1-test2-test3&quot;).text.sourceText;
word=t.split(&quot;-&quot;);
n = time/thisComp.frameDuration
word[n]
</code></pre>

CC BY-SA 4.0
2021-04-07T20:07:01.437Z
2021-04-07T20:07:01.437Z
smpa01
<p>I have newly started in AE and I came across source text animation.</p>
<p>I have a requirement where I want to show multiple text on source text keyframe animation. I was wondering instead of writing each text on the keyframe is there a way to automate this.</p>
<p>For example, I have created two text layers and the empty layer is referring to the data source (text source) and I know how to split them based on a delimiter. Please refer to the screenshot.</p>
<pre><code>t=thisComp.layer(&quot;test1-test2-test3&quot;).text.sourceText;
word=t.split(&quot;-&quot;);
word[2]
</code></pre>
<p>Now, Is there a way for me to tell AE to increase the value dynamically inside word[] in line 3 by +1.</p>
<p>If possible, I desire the code to return word[0] at 0000; word[<a href="https://i.sstatic.net/cdlAb.png" rel="nofollow noreferrer">1</a>] at 0001 and word[2] at 0002.</p>
<p>Many thanks in advance.</p>
<p><a href="https://i.sstatic.net/cdlAb.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/cdlAb.png" alt="project" /></a></p>

<after-effects><after-effects-expressions>
Automated source text animation based on split
smpa01
# Automated source text animation based on split

(Asked by: username_0 on 2021-04-07)

I have newly started in AE and I came across source text animation.
I have a requirement where I want to show multiple text on source text keyframe animation. I was wondering instead of writing each text on the keyframe is there a way to automate this.
For example, I have created two text layers and the empty layer is referring to the data source (text source) and I know how to split them based on a delimiter. Please refer to the screenshot.
t=thisComp.layer("test1-test2-test3").text.sourceText;
word=t.split("-");
word[2]

Now, Is there a way for me to tell AE to increase the value dynamically inside word[] in line 3 by +1.
If possible, I desire the code to return word[0] at 0000; word[1] at 0001 and word[2] at 0002.
Many thanks in advance.

**Tags:** after-effects, after-effects-expressions


---

## 1 answers

### Answer by username_0 on 2021-04-07. Score: 1 | Accepted answer

Found it
t=thisComp.layer("test1-test2-test3").text.sourceText;
word=t.split("-");
n = time/thisComp.frameDuration
word[n]


---

