Forums › Adobe After Effects Expressions › Compare sourceText
-
Compare sourceText
-
Avinash Ramanath
October 15, 2019 at 12:36 pmIs there a way to compare source text of the current layer with the text layer of another comp. I need to use this information to control some keyframe values
currently am using the below method but not getting any results.var chkText = comp("Comp 1").layer("Line_1")("ADBE Text Properties")("ADBE Text Document");
if(text.sourceText === chkText){
text.sourceText = "True"
}
else{
text.sourceText = "False"
}
-
Dan Ebberts
October 15, 2019 at 4:38 pmI think you just need to add .value when you reference the text. I’d do it like this:
var chkText = comp(“Comp 1”).layer(“Line_1”)(“ADBE Text Properties”)(“ADBE Text Document”).value;
text.sourceText.value === chkText ? “True” : “False”;Dan
-
Avinash Ramanath
November 4, 2019 at 6:36 amSorry for the late reply, Thanks for this Dan, I will check and share an update.
Log in to reply.