n = 0;
if (marker.numKeys > 0){
n = marker.nearestKey(time).index;
if (marker.key(n).time > time) n--;
}
if (n > 0){
time - marker.key(n).time + framesToTime(parseInt(marker.key(n).comment,10));
}else
0
The only thing I can think of would be a hack, but it might be useful. You could have a source text expression like this:
if (time < 0)
“your_extra_long_word_goes_here”
else
value;
Then you could use sourceRectAtTime() with a negative time to get the width of just that word. Then I’m not sure what you do, but hopefully that’s useful…
If you’re using a text file, the numbers start out as text, correct? So (I.m guessing) your expression must be using parseInt() or parseFloat() to convert the text to a number. If so, you can use isNaN() after the conversion to see if it actually created a number. Like this:
I can’t think of anything an expression could access that would be unique for each AE launch. You do get that automatically with scripting though, so I guess you could have a simple script populate a slider with a random number and use that as the random seed for your expression, but you’d have to remember to run the script each time you launch AE.