Sily question, in AppleScript studio is it possible to get more than three options in an Nspopupbutton. If so how?? :oops:
Cheers
Sily question, in AppleScript studio is it possible to get more than three options in an Nspopupbutton. If so how?? :oops:
Cheers
Hi James,
As you noticed, Apple documentation for any of their development tools is a really big piece of crap. So, discovering things like that is pure luck. I discovered a primitive way to add more items to a NSPOPUPbutton by pure chance. All you have to do is double click to open the 3 list items (at this time you will have one item selected) and click on COMMAND D, to duplicate that item.
Now I am fighting 12 more hours to discover how I detect which item was selected…
regards
First, this belongs under “AppleScript Studio & Xcode”, not “Mac OS”.
NSPopUpButton pops up a menu. If you need more items on it, add a menu item (MSMenuItem).
Use something like this to get a number:
get content of popup button 1 of window 1
If you want the text of the menu item, use something like this:
get title of current menu item of popup button 1 of window 1
As guardian34 said you can add a menu item to the list. Click on the nsmenu tool in the palettes window (leftmost, looks like a menu ;)), and drag the “item” menu item to the popup button. This is how you add separator items to the popup menu’s, too.
You can also hold the control? (or command?) key while clicking on an item in the popup menu to duplicate it (…sorry I’m on my wife’s computer and can’t remember which button it is :rolleyes:).
j