-
AE Scripting: Getting info from a text file
Hi!
I’ve been reading about scripting on Dan Ebberts VERY informative site http://www.motionscript.com. Particularly I found the article about creating text layers from a file very useful. However, I’m having some trouble getting AE to “behave” when there is a line break (and no text) in the file it is reading. What I want to do is make AE “skip” the “empty” line, and continue reading the file.
An example of text to be read:
Hello, world!
This is a test!
The line between “Hello, world!” and “This is a test!” is empty… If I replaced the line break with “-“, I got it working somehow with this code:
var text;
while (!myFile.eof){
text = myFile.readln();if(text==”-“)
myFile.readln();else
myComp.layers.addText(text);
But this not very efficient, since I would have to replace every line break with “-“…
As you guys might have figured out, I’m not a scripting expert, but I know some of you are… Hope you can help me out (It’s probably very basic…).
Cheers!