How to get value from a combobox item?

128 Views Asked by At

I would like to take the value selected by the user and add it to a button action.

For example: if you choose "Apple" and click on the open button it will open the Apple website. enter image description here

1

There are 1 best solutions below

1
TheOnlyOneHere On

I found out how to do this, below what I did.

property myComboBox : missing value


on btnOpen:sender
        set theValue to (myComboBox's objectValueOfSelectedItem()) as strings
       if theValue is equal "Apple" then
            open location "https://www.apple.com"
            end if
    end btnOpen: