Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Source text from external file

Explorer ,
Apr 23, 2020 Apr 23, 2020

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

TOPICS
Expressions
3.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Apr 23, 2020 Apr 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=...

 

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Apr 23, 2020 Apr 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 23, 2020 Apr 23, 2020

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Apr 23, 2020 Apr 23, 2020

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

'~/C/...'

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Apr 23, 2020 Apr 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 24, 2020 Apr 24, 2020
LATEST

Yes, dont work 😞

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines