The problem seems to be with the eval argument. If I manually write the text instead of the link, it works. If I try to force the link to a string, using var arr = eval(thisComp.layer(2).text.sourceText.valueAtTime(0).toString()); it still does not work.
LE:
I used this for the selector to be able to run a few tests:
var str = thisComp.layer(2).text.sourceText.valueAtTime(0);
var arr = eval(str);
typeof(str) == "string" ? 100 : 0;
I tested the length and typeof() from the str in the first line. They both match to the correct length and
“string”.
Finally, I have tested this and the string is correct. I really don’t know what goes wrong…
var str = thisComp.layer(2).text.sourceText.valueAtTime(0);
str === "[12,11,10,9,8]" ? 100 : 0;