-
Reeplace content of a layer
Hello ,
I am new to After Effects scripting and I have been playing with the language. This is the visual setup of the project I have :
Now , as a test , I have the following script :
app.project.activeItem.layers[1].sourceText.setValue('Hello World')If I run this little script, I am able to change the text of my layer 1 from This is a test to ‘Hello World’.
My question is , how can I do this operation when I am not active at the layer?
As far as I know , if we run :
var activeItemid = app.project.activeItem.id;
alert(activeItemid)I am able to get the id of the current item :
But , If I try :
app.project.item(activeItemid).layers[2].sourceText.setValue('This is just a test')It does not work.
Can you explain me how does this work?
Thank you.

