This text will be replaced

Expressions and External Documents

This tutorial explores how to set up an external text document to drive content for items like lower thirds and interstitials. Many many thanks to my friend Maltaannon for the idea to use the #include statement.

In the tutorial, the expression you see works great in CS3, but not in CS4.  I wrote a follow up to this for CS4. Many thanks to Lloyd Alvarez for much help on this.

16 Responses to “Expressions and External Documents”

  1. dex says:

    Thank you!!! I was looking for that explanation (in the tutorial) for a long time. Neither VideoCopilot, nor CreativeCow websites addressed this issue as well as you did.

  2. tobias says:

    thank you for this pretty usefull tutorial =)

  3. Ryan says:

    I think your web server butchered the media file http://www.graymachine.com/media/lowerThird2.mov as it only is 2.5 MB and you can only see about the first minute before it cuts off.

  4. Lotfaï says:

    Wow ! This is helping me a lot for the TV show I’m actualy producing almost weekly !! Thank you Harry !

  5. NIKITS says:

    VERY USEFUL and INSPIRED

    I am wondering if there is a way to:
    1. change numbers (temperatures) in certain positions (on a map)
    2. change symbols (clouds sun which are a tga sequence) in certain position also in the same map

    Make a weather forecast cards from an external document
    Will be great

    Thank a lot

  6. [...] This post was mentioned on Twitter by Jason Robb, Jason Robb. Jason Robb said: Just found a killer way to attach outside expressions to an After Effects layer: http://bit.ly/3OVNHg Alert!!! Nerd speak!!! [...]

  7. Social comments and analytics for this post…

    This post was mentioned on Twitter by invenio_jasonr: Just found a killer way to attach outside expressions to an After Effects layer: http://bit.ly/3OVNHg Alert!!! Nerd speak!!!…

  8. NIKITS says:

    1. So is there a way to attach in that external Document the information:
    To enable or not a not a NON text layer
    from a list of ten which are in th same comp

    2. Can we replace the TXT with an EXCEL file?

    EXAMPLE:
    Lets say that you want to write all this the Lower thirds (using the external doc)
    with the addition of a company logo which VARIES from a list of ten.

    Thanks

    • admin says:

      Excel has additional formatting that will screw up the expression. What needs to happen is someone needs to create a plug-in that will parse raw data like this. I’ve mentioned it to a few people, so hopefully I can push this along to happen, even if I have to do it my own damn self.

      As to the first question, yes… the external document is seen just like an expression. So, if the result is an integer, then it should work just fine.

      • NIKITS says:

        GREAT
        Excel file will be INNOVATION

        So as for the 1st
        “To enable or not (opacity)
        a not a NON text layer (logo) from a list of ten (waiting to support the text) which are in th same comp

        If i understand well:
        1.I have to place in the txt file
        a line matching each of ten logos (witch are in that comp in the same position)
        to be equal with 0 or 1 (transparent or not)

        2. I have to place in each of ten logos the same expression like the text file (to read data from a txt ……)

  9. rgbg says:

    Greetings, thank you so much for sharing this.

    I ran into one problem… I am trying to reference a multiline variable.

    When I use carriage returns, After Effects complains that the string constant has not been terminated.

    When I add \n to the string, AE just skips over it.

    The same thing happens when I concatenate strings with \n.

    Any ideas on how to add a linebreak to a variable? Can it be done in AE?

  10. rodrigotrovao says:

    didnt work here :(
    any cs4 windows 7 x64 solution? thanks a lot.

  11. rodrigotrovao says:

    Thanks my friend! I figured it out. Thanks for helping. My code sucessfull code was:

    path = “C:\\test\\test.txt” ;

    $.evalFile(path);
    text.sourceText = myvar;

    // myvar is a var created in test.txt
    // in test.txt i wrote :
    // myvar = ” my code is working”.
    // the message shows up in the screen.
    // Yey!