Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Source Text from Text File

  • Tom Granberg

    May 13, 2010 at 9:09 pm

    You are such a sport Dan!
    At least now I do not get an error on the path, so I assume that is correct now.

    However I do get this now, I tried to add “;” but that seems to not work.

    After effects warning: Expected: ;
    Error occurred at line 3.

    Using this:

    #include ‘/C/Users/Renderbrandt/Documents/text/code01.txt’;

  • Dan Ebberts

    May 13, 2010 at 9:18 pm

    1. What’s the entire text of your expression?

    2. What’s in your text file (exactly)?

    Dan

  • Tom Granberg

    May 13, 2010 at 9:24 pm

    First, thank you so much Dan for taking your time.

    All I want is to show the text from the .txt file, not read the text as code, just plain text.

    The entire expression is:
    #include ‘/C/Users/Renderbrandt/Documents/text/code01.txt’;

    I was going to to try “hack” an expression to show random lines of the text file too. But one step at the time I suppose.

    The text itself is actual a random code dump, I am using it as “generic” text for a computer screen on set.

    Again thank you for teaching me this.

    T

  • Dan Ebberts

    May 13, 2010 at 9:33 pm

    The file is going to get interpreted as JavaScript code, not text, so the file has to consist of valid javascript statements. The best you can do is probably put something like this in the text file:

    txt1 = “first line of text”;
    txt2 = “second line of text”;
    txt3 = “third line of text”;
    etc.

    Then in your expression you would have some code that would randomly display txt1, txt2, or txt3, etc.

    Dan

  • Tom Granberg

    May 13, 2010 at 9:37 pm

    Aha, Now I do understand!!!
    I wasnt aware that the file itself would be read as javascript.

    wow, I feel so……dumb

    T

  • Peter Auboeck

    January 27, 2011 at 2:18 am

    he guys

    this expression works great for windows., but i tried it with a mac an afx cs5 and it does not work at all !!! what could be wrong? i think there is a problem with the correct path. the file is on ” home” so teh path should be /text_test.txt but it isn`t

    can anybody help me

    thanx petee

Page 2 of 2

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy