Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions How to Combine 2 Seperate Expressions for Source Text Class?

  • How to Combine 2 Seperate Expressions for Source Text Class?

    Posted by Ali Veli on May 26, 2020 at 10:32 pm

    I have
    text.sourceText.style.setFontSize(comp("Infografik").layer("Controls").effect("M Text Center Font Size")("Slider"))
    and
    try{
    myPath = "G:/Workflow/Working/Infografik/Data/source.txt";
    $.evalFile(myPath);
    eval(thisComp.name)[0];
    }catch(err){
    "MISSING";
    }

    They works seperately as I wanted but I couldn’t managed to combine them. Could you please help me?

    Ali Veli replied 5 years, 11 months ago 2 Members · 2 Replies
  • 2 Replies
  • Andrei Popa

    May 27, 2020 at 6:01 am

    You need to encapsulate the values from your second expression in a variable and pass them to the first. Did not test this, but i think it should work.

    try{
    myPath = "G:/Workflow/Working/Infografik/Data/source.txt";
    $.evalFile(myPath);
    myVal = eval(thisComp.name)[0];
    }catch(err){
    myVal = "MISSING";
    }
    text.sourceText.style.setFontSize(comp("Infografik").layer("Controls").effect("M Text Center Font Size")("Slider")).setText(myVal)

    Andrei
    My Envato portfolio.

  • Ali Veli

    May 27, 2020 at 6:40 am

    It worked. Thank You! ????

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