-
Accessing text at specific keyframe
I’m trying to test the first two characters in a string from text I got from keyframed text on a different text layer. I’ve successfully returned the string at the specific keyframe, but I can’t access the first two characters.
watchLayerText = comp(“Typing”).layer(“firstPersonRefText”).text.sourceText.key(index);
//if(watchLayerText.toString().substr(0,2) == “##”)true else false;
//watchLayerText.charAt(0);This expression is in source text of another layer. When I just return watchLayerText it returns what I expect. However, using typeof I know what I’m grabbing is an object and not a string. When I cast it to a string all I get is “[Object Key]” and subsequent substrings of “[Object Key]”
Both commented out lines don’t work because I’m working off an object not a string. How do I access the first two characters of the string in the object key?