ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Using Javascript to load source text from an external text file?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
alex jones
Using Javascript to load source text from an external text file?
on May 29, 2018 at 10:26:29 am

Hello, I am trying to link my source text to an external text file (which works fine) BUT I don't know how to have 4 or 5 of them in one text layer.

I am currently using this in the source text:

$.evalFile("file path to my text document goes here");
eval("variable name in the text file I want to use goes here")

Can I house this as a variable somehow? Basically I want to make one text layer with 4 or 5 of these in seperated by normal text that does not change

So for example:
var1 = $.evalFile("file path to my text document goes here");
eval("variable name in the text file I want to use goes here")

var2 =$.evalFile("file path to my text document goes here");
eval("different variable name in the text file I want to use goes here")

"hello there" + var1 + "my name is" + var2



How do i write that correctly? Thanks

p.s. I am running the latest After FX CC etc

$.evalFile("file path to my text document goes here");
eval("variable name in the text file I want to use goes here")


Return to posts index

Dan Ebberts
Re: Using Javascript to load source text from an external text file?
on May 29, 2018 at 4:03:15 pm

If your file looks like this:

var1 = "Name 1";
var2 = "Name 2";

Then something like this should work:

$.evalFile("/c/test/test.jsx");
"hello there" + var1 + "my name is" + var2


Dan



Return to posts index

alex jones
Re: Using Javascript to load source text from an external text file?
on May 29, 2018 at 5:05:11 pm

perfect, thanks dan!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]