ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Re: Trying to find a specific word and see the priority in the text layer.

COW Forums : Adobe After Effects Expressions

FAQ   •   VIEW ALL   •   ADD A NEW POST   •   PRINT
Respond to this post   •   Return to posts index   •   Read entire thread


Tomas Bumbulevičius
Re: Trying to find a specific word and see the priority in the text layer.
on Mar 11, 2020 at 2:18:08 pm

Hey Kyung,

here is the idea:
1. First layer in the comp - reference.
2. Second layer - new order.
3. Third - result.

This can be changed of course, but for better visual clue, I made it this way.


Seems to do what it is suppose to.

refText = thisComp.layer(1).text.sourceText
curText = thisComp.layer(2).text.sourceText

refArray = refText.split(",");
curArray = curText.split(",")

res = "";

for(i=0; i<refArray.length; i++){

refText = refArray[i];
for(j=0; j<curArray.length; j++){
curText = curArray[j];
if (refText == curText){
curIndex = j;
}
}
res = res + refText + "=" + (curIndex+1).toString() + ",";
}

res



Find out more:
After Effects Tutorials: motion design, expressions, scripting.
Boxer - Dynamic Text Boxes Template with a Live Preview


Posts IndexRead Thread 


Current Message Thread:





© 2020 CreativeCOW.net All Rights Reserved
[TOP]