I am now trying to get the fonts from all the text layers I found;
Iterating through the layers Array isn’t working(” undefined” ), I think because it is a layer object;
tried to push the layer name …. theArray.push(theComp.layer(i).name).toString()); which did return an array of layers name, but couldn’t get the font name of each layer ;
Thank you for your help
shai
var activeItem = app.project.activeItem;
var myComp;
if ((activeItem !== null) && (activeItem instanceof CompItem))
{myComp = app.project.activeItem} else {
alert ("please select a comp");};
var myTextLayers = [];
processComp(myComp,myTextLayers);
alert(myTextLayers);
for (var k=0; k<=myTextLayers.length;k++){}
var mySourceText = myTextLayers[k];
var mySourceText = TextLayer.property("ADBE Text Properties").property("ADBE Text Document");
var myTextDoc = mySourceText.value;
var fCurName = myTextDoc.font;
alert(fCurName);
function processComp(theComp,theArray){
for(var i = 1; i <= theComp.numLayers;i++){
if (theComp.layer(i) instanceof TextLayer){
theArray.push(theComp.layer(i));
}else if (theComp.layer(i).source instanceof CompItem){
processComp(theComp.layer(i).source,theArray);
}
}
}