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

Help with dropdowlist items:

Engaged ,
Jan 08, 2020 Jan 08, 2020

Copy link to clipboard

Copied

Hello friends!
What is the regular expression to modify this script so that it can do a type inverse function; instead of identifying the suffix "B", change to identify the prefix? "D item 5"?
Thanks.

dialog = new Window("dialog"); 
dialog.text = "Dialog"; 
dropdown1_array = ["Item_1 A" ,"Item_2 B" ,"Item_3 C","Item_4 B", "D item 5"]
dropdown1 = dialog.add("dropdownlist", undefined, undefined, {name: "dropdown1", items: dropdown1_array}); 
dropdown1.selection = 0; 
dropdown1.preferredSize.width = 300; 

dropdown1.onChange = function(){
    if(dropdown1.selection.text.match(/B$/)){// match(/B$/)) edite
        alert ("B")
     }
}

dialog.show();
TOPICS
Actions and scripting

Views

616

Translate

Translate

Report

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

LEGEND , Jan 08, 2020 Jan 08, 2020

 

/^D/

 

Votes

Translate

Translate
Adobe
LEGEND ,
Jan 08, 2020 Jan 08, 2020

Copy link to clipboard

Copied

 

/^D/

 

Votes

Translate

Translate

Report

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
Engaged ,
Jan 08, 2020 Jan 08, 2020

Copy link to clipboard

Copied

LATEST

Hi Kukurykus nice to see you again! It worked here, thanks for the help.

Votes

Translate

Translate

Report

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