Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions .txt files and relative paths: this might be a step towards a solution

  • .txt files and relative paths: this might be a step towards a solution

    Posted by Gabriele Bartoli on November 25, 2015 at 1:00 am

    Hello again.

    I’ve been looking around and it seems like it is not possible to use a relative path to point to a file when using expressions. Today though I got this to work:

    try{
    myPath = "../Grafiche/ePriceData.txt";
    $.evalFile(myPath);
    eval(thisComp.name)[index - 1];
    }catch(err){
    err;
    }

    This allows the expression to go one step up the hierarchy relative to the project’s folder, then enter the folder Grafiche and find the txt file.
    Too bad that the project file and txt file are in the same folder and having to go through this extra step defeats the whole purpose of using the relative path. I’m posting this so that it might turn on the proverbial light bulb in someone else’s mind and lead us to a solution.

    On a side note, I am working on windows but I have to use “/” instead of “\” in the path to make everything work. Curious.

    Cheers

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

    November 25, 2015 at 4:09 pm

    Update: today I opened the project after turning on my machine, and the path shown above was not working anymore. I assume it was working yesterday because I somehow managed to declare the myPath variable as a global variable. I tried to recreate the conditions but I can’t seem to be able to do that. Oh well, too bad. 🙁

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