Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions evalFile local path?

  • evalFile local path?

    Posted by Darren Lee on November 13, 2020 at 10:06 am

    Hi,

    I am external expressions with evalFile, using absolute paths:

    $.evalFile("/Users/Dave/Desktop/Project/Expression.js");

    I want to pass on the files to another developer, so would prefer to use local paths:

    $.evalFile("Expression.js");

    is this possible? I’m on a mac?

    Thanks

    Darren Lee replied 5 years, 5 months ago 2 Members · 4 Replies
  • 4 Replies
  • Trent Armstrong

    November 13, 2020 at 1:40 pm

    Dan Ebberts has some thoughts on this where you use a text layer inside the AE project to house the expression.

    txt = thisComp.layer(“Text”).text.sourceText.value;
    eval(txt)

    You can then send over AE projects with expressions in text layers to anyone Mac or Windows that they import into their project and then set up the correct reference.

  • Darren Lee

    November 13, 2020 at 2:05 pm

    Thanks Trent, I’ve actually used that method before. The reason I have external scripts though is to use then in an editor..

  • Trent Armstrong

    November 13, 2020 at 3:05 pm

    Okay! Cool! Use the ~ to get to the Desktop of any user on Mac.

    myPath = “~/Desktop/Project/Expression.js”;

    $.evalFile (myPath);

  • Darren Lee

    November 13, 2020 at 9:15 pm

    Thanks

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