Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions txt file to text layer problems

  • txt file to text layer problems

    Posted by Tim Williams on November 27, 2015 at 10:34 am

    Hi All,

    Two questions:

    1. Is there anyway to get a script to read all the text layer values from a txt in advance, rather than on a per layer expression basis?

    2. I’m running CS6 on a mac and using expressions I use the following code:

    try{
    myPath = “~/Desktop/text.txt”;
    $.evalFile(myPath);
    eval(thisComp.name)[0];
    }catch(err){
    “MISSING”;
    }

    with text.txt reading:
    var comp1=[“Hello World”];

    Obviously my comp is called comp1.

    If I capture the error I get a syntax error line 1.

    Any suggestions appreciated. It’s driving me nuts !

    Many thanks,

    T

    try{
    myPath = "~/Desktop/text.txt";
    $.evalFile(myPath);
    eval(thisComp.name)[0];
    }catch(err){
    "MISSING";
    }

    Gabriele Bartoli replied 10 years, 8 months ago 2 Members · 1 Reply
  • 1 Reply
  • Gabriele Bartoli

    December 3, 2015 at 4:48 pm

    If I had to bet, I’d say your problem lies with the “” inside the txt file. Try to retype them or make sure they are the proper character.

    The code itself works for me, I just pasted it as source text in a new project and I obviously get “MISSING” because I don’t have the txt file on my desktop.

    Hope this helps 🙂

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