That’s fair enough, my machine was fine with the data, but if it’s a burden. Can completely understand.
var name = myObject[0].name;
So you’ve seen how to pull the info. Add to your script.
I used it this way, but I wouldn’t say it’s the best. That was to change the layers name and using sourceText to use the Layers name as it’s text.
var myComp = app.project.activeItem;
myComp.layer(1).name = name;
if you want to import the value into source text. Same thing
var myComp = app.project.activeItem;
but then you need to use something to reference. Wether you aren’t making changes to the layers number
myComp.layer(1).property(“Source Text”).setValue(“Test”);;
or if you layers name is always going to be the same.
myComp.layer(“layers name”).property(“Source Text”).setValue(“Test”);
Now you can do this as a for loop expression, but not going to lie, I’ve not used that in this context and I’m relatively new to this myself, but this should get you started hopefully.
Another way to look at it maybe as well is with keys at the front. Again, I’ve used that with 2018 but not with a script at all. That could be another way to look at it so you could reference layer based on name.
myObject[0].name
myObject[1].name
myObject[2].name
so it would look more like this
myObject.james.name
myObject.scott.name
myObject.sam.name
This you could then use in an expression that would again loop through all the layers and if it sees any with that key in as the layer name could use that.
Sorry for the waffle but other than this, I used cc2018.
var name = myObject[0].name;
var myComp = app.project.activeItem;
myComp.layer(1).property(“Source Text”).setValue(name);