-
Expression Code from external text file
Hello,
again i seek the help of this community. It’s nothing big this time, I am sure the solution is a quick one.
Here is the problem:
Recently, i have been looking into ways of having text layers load their source text property from external text documents. It is pretty straight forward. I am using a slightly modified code based on this: https://www.graymachine.com/2009/04/expressions-and-external-documents-revisited/
Now instead of referencing source text only, I want to have all expressions that i am using in external files stored on a fixed location of a server. And here is where it fails. I tried putting a simple expression into a text file and have it load… not working. Here is what i have:
a text layer named “year”, that contains a company name as well as a dynamically updating date information. This expression is featured in the source text parameter of the text layer “year”
x=”© name”;
D = new Date(Date(0));
“r” + “r” + “r” + “r” + x + ” ” + D.getFullYear();I have put that into a text document in the following way, similar to regular source text information:
var year = [x=”© name”;
D = new Date(Date(0));
“r” + “r” + “r” + “r” + x + ” ” + D.getFullYear();]Thing is, if i replace the expression within the [] by plain text, something like “Hello”, it will be displayed properly. If i put the above expression in there, my error catch gives me notfound, which means something is broken. How can i make the above expression work from the external document? Or does this only work with text only and not with entire lines of code?