-
ExtendScript – How to find & select a comp and edit the Text layer?
I’ve been trying to figure out how to find and select a comp, and then edit the text layer without opening. I was hoping to set its value using a user-prompt string that’s pasted in when the script is invoked.
This script keeps returning the result as undefined, so I can’t make any progress.
var myPath = prompt("Directory?", "Paste path")
for (var i = 1; i <= app.project.numItems; i ++) { if ((app.project.item(i) instanceof CompItem) && (app.project.item(i).name =="DataPath")) { var myComp = app.project.item(i); break; } }Edit::
So I think I was just typing in the wrong comp name.
The only thing I wanted to figure out at this point was how to set the value of a text layer. Something like redefinery's rd: Edit Text script where the text is the stuff i paste into the prompt at the beginning of the script, without changing the expression in the text layer.