Pop Up Button always has the same value in AppleScript

applescriptxcode

I have a Pop Up Button in Xcode with multiple choices, they are All, 1, 2 3, etc. to 15.

In my AppleScript code I call it ItemPicker:

property ItemPicker : missing value

I have made a Referencing Outlet from "ItemPicker" to Delegate. When I use the value later in the code, I do this:

set multiple to ItemPicker's stringValue() as string

But for some reason, multiple is always 1. How do I fix this?

Best Answer

Have you checked out Stefan's answer to this question on MacScripter? He says to make a handler like this:

on didSelectItem:sender
    log sender's titleOfSelectedItem() as text
end didSelectItem

Then connect the handler to the selector on the popup button.

Link to MacScripter article: http://macscripter.net/viewtopic.php?id=43906