-
Conditional expression for box size
Hi all, I’m trying to create a text box that will size to the to width of the longest text.
Currently using this conditional expression but it only works for the first 2 values
n = thisComp.layer("NAME TEXT").sourceRectAtTime();
p = thisComp.layer("PROFESSION TEXT").sourceRectAtTime();
u = thisComp.layer("USERNAME TEXT").sourceRectAtTime();if ((n.width > p.width) || (n.width > u.width)) {
[n.width + 100, 135]
}
else if ((p.width > n.width) || (p.width > u.width)) {
[p.width + 100, 135]
}
else {
[u.width + 100, 135]
}Not sure what I am doing wrong, thanks for your help!