Source text from external file
Copy link to clipboard
Copied
Hi everyone,
I need your help. I have an animation where I wish to apply text from an external file to particles. For that I need a text layer where every frame is another word.
Every experession I tried failed:
myPath = "/C/Temp/text_test.txt";
$.evalFile (myPath);
f = timeToFrames();
txt[Math.min(f,txt.length-1)]
Or:
myPath= "/C/test1.txt";
$.evalFile(myPath)
And what kind have to be the file I import? I mean every line should be somehwo marked?
Thanks.
Swenia
Copy link to clipboard
Copied
I did a quick google search and found this:
However, $.eval() seems only work if the expression engine is set to ExtendScript.
I didn't find a way to make it work with JavaScript expression engine.
*Martin
Copy link to clipboard
Copied
Just realized that's the code you are already using...
I think the nowadays approach is to use a JSON instead of a simple text and do the workflow for data driven animations.
*Martin
Copy link to clipboard
Copied
Its OK, Ive tried I lot of vairants and no one works 😞
Copy link to clipboard
Copied
Have you tryed to add '~' to the path?:
'~/C/...'
Copy link to clipboard
Copied
I did while testing an older expression for that which used to work. If the expression engine is set to ExtendScript, the expression is working as intended, but if the engine is JavaScript, the same expressions fails.
Unfortunatly the JS methods open() and read() aren't implemented - therefore I think Adobe cut off this path.
JSON like in data driven animations seems to be the new way.
*Martin
Copy link to clipboard
Copied
Yes, dont work 😞

