Creative COW SIGN IN :: SPONSORS :: ABOUT US :: CONTACT US
ADOBE AFTER EFFECTS: HomeForumBasicsExpressionsTutorialsPodcastsMotion GraphicsTrainingCinema 4DFAQ

CS4 Source text load from external .txt file

Cow Forums : Adobe After Effects Expressions

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>
CS4 Source text load from external .txt file
by Chad Dankert on Jul 1, 2009 at 3:34:16 pm

I have been using the following source text expression in my CS3 projects to load text dynamically for lower thirds and titles:

#include'/media/text.txt'

try{
eval(thisComp.name)
}
catch(err){"not found"}


The external .txt file is formatted as follows:

L3_01 = "FirstName LastName"

L3_02 = "FirstName LastName"
;


And the comps in the AE file match those in the text file accordingly.

I just recently upgraded to CS4 and the expression no longer works. Any help on loading text dynamically in After Effects CS4 would be greatly appreciated.

Thanks in advance.

cd

Respond to this post   •   Return to posts index

Re: CS4 Source text load from external .txt file
by Dan Ebberts on Jul 1, 2009 at 4:54:54 pm

Try this:

myPath = "/media/text.txt";
try{
$.evalFile (myPath);
eval(thisComp.name);
}catch (err){
"not found"
}


Dan



Respond to this post   •   Return to posts index

Re: CS4 Source text load from external .txt file
by Chad Dankert on Jul 2, 2009 at 2:02:12 pm

Thanks Dan. That works perfectly.

Next question, is it possible to cut the path in the expression down to the relative path to the AE project? Currently I'm having to use the absolute path...

Thanks again.

chad

Respond to this post   •   Return to posts index


Re: CS4 Source text load from external .txt file
by Dan Ebberts on Jul 2, 2009 at 5:46:27 pm

I can't think of a good way to do that. A script can get at the path to the project, but I don't think an expression can.

Dan



Respond to this post   •   Return to posts index

Re: CS4 Source text load from external .txt file
by Pierre-Alexis Tremblay on Jul 2, 2009 at 4:08:53 pm

Would it be possible to get an expression from an external text file as well?


P.A.T.

Respond to this post   •   Return to posts index

Re: CS4 Source text load from external .txt file
by Dan Ebberts on Jul 2, 2009 at 5:22:55 pm

Actually that's what you're doing -- putting part of the expression code in a text file. You could certainly put it all in there.

Dan



Respond to this post   •   Return to posts index

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>


FORUMSTUTORIALSMAGAZINETRAININGVIDEOS - REELSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

© CreativeCOW.net All rights are reserved.

[Top]