Copy link to clipboard
Copied
Hi all, I have looked all over for an answer and haven't found it. Sorry if it was overlooked. I'm sure this is a super simple item I am missing.
I am trying to create a text layer that changes the font based on a Dropdown Menu control. The below code is the example code that Adobe gives to begin exploring this tool but I always get the error I've placed beneath that. Can anyone point me in the right direction?
Expression:
var dropDownMenu = thisComp.layer("LayerName").effect("Dropdown Menu Control")("Menu");
switch (dropDownMenu.value) {
case 1 :
text.sourceText.style.setFont("Georgia");
break;
case 2 :
text.sourceText.style.setFont("Impact");
break;
default :
text.sourceText.style.setFont("Tahoma");
}Error:
Thanks for any help.
It works for me. My guess is that you have Project Settings > Expressions set to Legacy ExtendScript.
Copy link to clipboard
Copied
It works for me. My guess is that you have Project Settings > Expressions set to Legacy ExtendScript.
Copy link to clipboard
Copied
Oh my goodness. Thank you!! I thought I was going crazy. This now works.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now