-
Layer names from csv
Hi everyone.
I came to you with a problem I’m struggling with. At the beginning I must write that I do not know how to write scripts, all my struggle consists in trying to modify existing ones.
Is it possible to write a script that will rename layers by taking the names from a csv file? In my case i’m working on duplicated precomps with master properties. Every new duplicate of layer takes values from csv, based on layer index. I would like to change the names of layers collectively, based on data from the same csv, only, for example, from column No. 2, where I have the name and surname of the person.
I found two scripts at this forum:
First:
app.project.activeItem.selectedLayers[0].name = "BG"app.project.activeItem.selectedLayers[0].name = "Matte"Second:
crtComp = app.project.activeItem;for (var i=1;i<=crtComp.numLayers;i++){
currentLayer = crtComp.layer(i);
if(currentLayer instanceof TextLayer){
crtComp.layer(i).name = crtComp.layer(i).text.sourceText.value;
}
}both written by Andrei Popa
First one working great, but i can,t modify it to take data from csv and batch working. Second one is changing name of text layers, so if i take values of textsource from csv it works, but only on text layers.