ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Source Text Expression for Subtitles

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Jennifer Arani
Source Text Expression for Subtitles
on Mar 15, 2013 at 4:37:21 pm

I found a tutorial on how to bring in the speech/text metadata from premier to AE and then assign an expression to display the text 5 words at a time.
The good news is that I got the script to work and work very well. The bad news is that the script will look for and display 5 words at a time. But there are pauses and music in between some scenes. I need to either add or adjust the script so that I can either have it look for some kind of end cap or notation so that it will, for example, show only 3 words. Stop displaying any text until it sees a second notation that tells it to start displaying it again.

Any help would be appreciated! If not I will have to copy and paste the script for like 20 videos!

Here is a link to the tutorial -

And a copy of the script (adjusted for CS6 and per the instructions in the tutorial)
L = thisComp.layer("");
max = 9;
n = 0;
if (L.marker.numKeys > 0) {
n = L.marker.nearestKey(time).index;
if (L.marker.key(n).time > time) {
s = " ";
if (n> 0){
base = Math.floor((n-1)/max)*max + 1;
for (i = base; i < base + max; i++){
if (i <= L.marker.numKeys){
s += L.marker.key(i).comment + " ";

Thank you!

Jennifer Arani

Return to posts index

John Cuevas
Re: Source Text Expression for Subtitles
on Mar 15, 2013 at 4:44:16 pm

You might want to post this on the AE expressions forum, there are a couple of guys who read that forum regularly(they sometimes miss things on this forum) who might be able to help you out.

Johnny Cuevas, Editor

"I have not failed 700 times. I have succeeded in proving that those 700 ways will not work. When I have eliminated the ways that will not work, I will find the way that will work."
---THOMAS EDISON on inventing the light bulb.

Return to posts index

Todd Kopriva
Re: Source Text Expression for Subtitles
on Mar 15, 2013 at 11:32:31 pm

Dan Ebberts wrote the code that is in that tutorial, and he's active on the Expressions forum. So, as Johnny said, that's a good place for this question.

Todd Kopriva, Adobe Systems Incorporated
After Effects quality engineering
After Effects team blog

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved