Working with drop down menus using UI Scripting

Hello All,

I’m trying to write AppleScript UI Script code to work with drop down menus. The ones you click and select an item, such as the web forms you see where you click and select a state.

I can’t seem to figure out how to click and select a specific item in the menus.

Please Help,
Thanks,

Hi and welcome. :slight_smile:

Sorry, too less information!!

There are two kinds of UI elements which perform drop down menus:
pop up button and menu button, both are differently scriptable.

What are you going to accomplish? Do you have an example?

Right now I’m having troubles with the pop-up button.

I’m able to get the current value by using “get value of (reference to the item)”, but I can’t seem to set the value of the item using the "set value of " construct.

I notice that there is a sub menu object that’ll exist briefly when I click on the pop-up button, but saying, “click (reference to the menu item)” doesn’t seem to work. I get a NSScriptError 4.

I hope this helps…

Thanks,

I use normally this syntax


.
tell pop up button "whateverItsNameIs"
	perform action "AXPress"
	delay 0.5
	click menu item "where" of menu 1
end tell
.