Thank you so much, Alex! I don’t know why your specific code didn’t work for me, but you set me off in the right direction with sourceRectAtTime(). I found a similar chunk of code from Dan Ebberts elsewhere that led me to the solution below. Only oddity in this code was that I had to add a “padding” variable in order for the position value to match the manual setting I had before. Not a big deal, and this saves me so much time!
// text layer
t = thisComp.layer("text");
// paragraph text height
r = t.sourceRectAtTime(time,true).height;
// font line height + padding
y = 75;
p = y + 5;
// paragraph height divided by line height = # of lines
n = r/y;
// removes any decimals
n = n.toFixed(0);
/* code below spits out the Y Position values
for my 2 keyframes based on knowledge of
how many lines, up to 8 lines */
lines = 340 + p;
c = 0;
do {
lines = lines - p;
c++;
}
while (n > 1 && n < 9 && n != c);
lines;
if (numKeys > 1){
k1 = key(1).time;
k2 = key(2).time;
v1 = lines;
v2 = 473;
linear(time, k1, k2, v1, v2);
} else {
value
}