ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

expression to read from a Text file - how to be able to edit text after import?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Eran Peled
expression to read from a Text file - how to be able to edit text after import?
on Jul 17, 2017 at 8:47:30 am

hello
i have a script which let you open the browse dialog to select a text file. then in AE i have some text layers, which receive the text data from the text file.
but cause the expression, i'm not able to edit the text afterward. (only if i update the text file it self, it get updated). is there a way to allow to the user work on the AE to update the text file?

the script is:
var myComp = app.project.activeItem;
var theFile = File.openDialog("select the file");

{
var layer = myComp.layer("Path");
if (layer instanceof TextLayer)
{
layer.sourceText.setValue(theFile.absoluteURI);
}


and the expression i put on the textSource is:
myPath = thisComp.layer("Path").text.sourceText;
try{
$.evalFile (myPath);
eval(Bullet2);
}catch (err){
"not found"
}


by the way, i created a text layer, name Path, which get the exact path of the selected text file.

thanks!!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]