Skip to main content
Participating Frequently
April 23, 2020
Question

Source text from external file

  • April 23, 2020
  • 2 replies
  • 3386 views

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

This topic has been closed for replies.

2 replies

migueld83371718
Inspiring
April 23, 2020

Have you tryed to add '~' to the path?:

'~/C/...'

Martin_Ritter
Legend
April 23, 2020

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

Martin_Ritter
Legend
April 23, 2020

I did a quick google search and found this:

https://forums.creativecow.net/docs/forums/post.php?forumid=227&postid=15319&univpostid=15319&pview=t

 

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

Martin_Ritter
Legend
April 23, 2020

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

sweniatAuthor
Participating Frequently
April 23, 2020

Its OK, Ive tried I lot of vairants and no one works 😞