-
Error in expression for reading a file
Hello,
I have the following expression:
var myPath = "~/Desktop/source.txt";
$.evalFile(myPath);
try {
eval(thisComp.name + thisLayer.name);
} catch (err) {
"Missing";
}And I keep getting an error message:
Error at line 1 in property 'Source Text' of layer 1 ('TitleLayer') in comp 'Comp1'. Syntax error.Every place I look, I see this expression (or a very similar one) to read text from a file, but this doesn’t seem to work.
Now, I have After Effects CC. Is there something that I need to do differently in this version, or did I not enable some option?
Thanks for any help you can provide about this.
Just so you can see what’s in my source.txt, here it is:
var Comp1TitleLayer = "Some Text";
var Comp1SubTitleLayer = "Some More Text";(this is just for getting it right so far)