-
How to override Out of Range error in an expression
Hi everyone,
I want to to use, for instance, the sourceRectAtTime(time).width value from the same layer index in another comp:
w = comp(”Another Comp”).layer(index).sourceRectAtTime(time).width;
This work fine as long as the corresponding layer in the other comp a) exists b) is able to return the kind of value I’m asking for. I. e. it has to be at text layer. Otherwise it will cause an out of range error.
My question is:
How do i ”test” if there will be an error before it is executed, so I can avoid it with a simple if..then..else like:if (comp(”Another Comp”).layer(index).sourceRectAtTime(time).width=ERROR) {do nothing} else {do this and that}
Thank you!
Mikael