ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

How to Combine 2 Seperate Expressions for Source Text Class?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Ali Veli
How to Combine 2 Seperate Expressions for Source Text Class?
on May 26, 2020 at 10:32:41 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?


Return to posts index

Andrei Popa
Re: How to Combine 2 Seperate Expressions for Source Text Class?
on May 27, 2020 at 6:01:51 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.


Return to posts index

Ali Veli
Re: How to Combine 2 Seperate Expressions for Source Text Class?
on May 27, 2020 at 6:40:45 am

It worked. Thank You! 😄


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 CreativeCOW.net All Rights Reserved
[TOP]