i have the code:
set theProtocol to current item of combo box "Protocol" of window "main"
but that comes up with the error: “NSRecieverEvaluationScriptError 4 (1)”.
how you get the current item of a popup box??
i have the code:
set theProtocol to current item of combo box "Protocol" of window "main"
but that comes up with the error: “NSRecieverEvaluationScriptError 4 (1)”.
how you get the current item of a popup box??
Your code as posted worked fine for me, which leads me to believe that the item you’re targeting doesn’t exist. Check your AS names and make sure they are spelled and capitalized properly. Otherwise, these all work for getting various attributes of a combo box or it’s items…
--> Get the contents of the combo box
set theProtocol to contents of combo box "Protocol" of window "main"
--> Get the contents of the current item (virtually the same as above)
tell combo box "Protocol" of window "main"
set theProtocol to combo box item (current item)
end tell
--> Get the 0-based index of the current item
set theProtocol to current item of combo box "Protocol" of window "main"
--> Get the contents of an item by it's index (without selecting it)
set itemIndex to 3
set theProtocol to combo box item itemIndex of combo box "Protocol" of window "main"
j