-
Selecting and altering a text layer in a script
Hey guys,
I’m a bit confused with the method by which one selects comps in Scripts versus expressions, but need to write as script to select a bunch of text layers and change their attributes. RIght now I have something similar to the code posted below, which In theory should select the 8th item down, then the first layer in that (a text layer), and then the value of its source text property– but apparently I’m getting the layer selection wrong. thisComp apparently doesn’t exist in scripting, and I’m not sure how to select the current comp without needing explicitly to select the comp I’m working in via activeItem since there are several comps with text layers that need to be changed in batches, and I’d prefer to ID them objectively through the script.
Thanks for any insights you have!
var textToEnter = prompt("Enter replacement text", "");
app.project.item(8).layer(1).property("Source Text").value = textToEnter;