Skip to main content
Michael.Asgian
Participant
January 31, 2016
Question

Link an external text variable with expression

  • January 31, 2016
  • 1 reply
  • 486 views

Windows machine, latest AFX CC

source01.txt contains

L3="Text to be inserted"

In the text layer, Source text expression is:

myPath = "/v/iv/source01.txt";

try{

$.evalFile (myPath);

eval(L3);

}

catch (err)

{

"error"

}

I only get the Error in the text layer

What am I doing wrong? Help please

This topic has been closed for replies.

1 reply

Alex White
Legend
January 31, 2016

You are missing colon.

So path should look like this one:

myPath = 'A:/Users/alex/Desktop/expressionsCollection.jsx';

If you want to user shorten path, it is gonna be like this:

myPath = '~/Desktop/expressionsCollection.jsx';

Michael.Asgian
Participant
February 11, 2016

Thanks Alex!
Is there any way I can do a "current project folder path" ?

Alex White
Legend
February 11, 2016

I've tried several methods, but not succeed. So as far as I know you are not able to access current project folder path from expressions.