Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Connecting font to drop down menu

New Here ,
Dec 15, 2021 Dec 15, 2021

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:

TrevorP_0-1639613508514.png

 

Thanks for any help.

TOPICS
Error or problem , Expressions
305
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Dec 15, 2021 Dec 15, 2021

It works for me. My guess is that you have Project Settings > Expressions set to Legacy ExtendScript.

Translate
Community Expert ,
Dec 15, 2021 Dec 15, 2021

It works for me. My guess is that you have Project Settings > Expressions set to Legacy ExtendScript.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 15, 2021 Dec 15, 2021
LATEST

Oh my goodness. Thank you!! I thought I was going crazy. This now works.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines