ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Reading a txt file

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Frank Lima
Reading a txt file
on Jun 12, 2012 at 2:04:40 am

I am using Expressions to read in an external txt file into a text layer. How would I just be able to read the contents of a txt file into the text layer's 'source text' attribute?


Return to posts index

Frank Lima
Re: Reading a txt file
on Jun 12, 2012 at 6:38:36 pm

I have this piece of code here but it makes a comparison and all I want it to do is just read the contents of the txt file:

try
{
//If Apple OS X, then use this directory format
if ($.os.indexOf("Mac") != -1)
{
myPath = "/directory/";
}
//If using Windows XP and above, use this directory format
else
{
myPath = "file://c:\\directory\";
}

//Must use dynamic name allocation in relation to after effects name, using data.txt as a temporary placeholder
myPath += "data.txt";

//COMPARISON DONE HERE, JUST WANT TO READ CONTENTS OF THE TXT FILE
$.evalFile (myPath);
eval(thisComp.name);
}

//Catch and display error if no file is found
catch(err)
{
"File Not Found";
}


Return to posts index

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