Forum Replies Created

Page 2 of 2
  • Shai Benshoshan

    March 14, 2018 at 10:31 pm in reply to: Get all nested comps from a selected comp ?

    Many Thanks!
    Now that I can collect the fonts to an array, in a composition with 300 font nested, most of them copies of one font),
    I need to sort the array so fonts that are already in the array will be excluded.
    Thanks again;

    Shai

  • Shai Benshoshan

    March 14, 2018 at 12:21 pm in reply to: Get all nested comps from a selected comp ?

    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);
    }
    }
    }

  • Shai Benshoshan

    March 14, 2018 at 9:50 am in reply to: Get all nested comps from a selected comp ?

    Working like magic!
    A function that runs on itself
    Thanks, Dan !

  • Well, He is The best!
    Thank you, Scott!
    Thank you, Dan, for sharing all that essential knowledge and wisdom(||)

Page 2 of 2

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy