Forums › Adobe After Effects Expressions › propertyIndex AND sourceText.split question
-
propertyIndex AND sourceText.split question
-
Chris Scalzo
June 12, 2018 at 9:00 pmI wanted an expression on a text layer to mark #HASHTAGS and @SocialMediaNames blue. So I added the following code to the amount of color change in a bunch of Range selectors named 0, 1, 2…
When I evalucate the value of x, it is the correct number, but this expression wouldn’t work unless I typed a number.
I replaced
y=text.sourceText.split(” “)[x][0];with
y=text.sourceText.split(” “)[1][0];Also, if a gave it text that had two spaces, it through off the split from the value of the range selector.
x=thisProperty.propertyGroup(1).propertyIndex-1;
y=text.sourceText.split(" ")[x][0];
if ((y == "#") || (y == "@")) 100 else 0 -
Chris Scalzo
June 18, 2018 at 7:16 pmI figured out what was wrong with my property index syntax. I am still looking for a solution to my text.split problem. will reword in a new post.
Log in to reply.