AppleScript Studio - Setting a popup button's title or currently-selected menu item

Syntax example of how to set a popup button’s currently selected item and/or title.

  • NOTE: This action is independent of the menu items themselves. So, if your desired title needs to be a member of the current menu item list, use the second example.

OS version: OS X

set title of popup button "my_popup_button" of window "my_window" to "foobar"

set current menu item of popup button "my_popup_button" of window "my_window" to "foobar"