Popup Menu

Hi!

How do I reference a popup menu, I want different scripts to run if my button is clicked when the menu has different items selected, but I don’t want it to run when the menu item is clicked. How can I do this?

Hi,

May be you need to rephrase your sentence. It seems so convoluted and confusing to figure out what you want to do.

I am not a native English speaker so I may have a problem with it but it does look that way. Perhaps if you can make it clearer then I can try to figure out if I can help you with your problem or perhaps, other more knowledgeable people could - assuming that they are just as confused right now. Yes?

Thanks.

archseed :slight_smile:

Sorry archseed,

I have a popup menu, and it has three items in it. The same window also has a single button, named “GO!”. When I click the button, how do I get the name of the item active in the popup menu?

Jamie:

I am sure that there are other methods, but here is what I do. As soon as the popup menu is is populated, I set the variable that I want to hold the value of that menu to the first item in the menu list:

set popup_Value to (popup_List's item 1) --popup_List is the list of items used to build the popup list 

In this way, if the user never chooses anything else, then the value of the variable popup_Value is the first menu item of the popup list, whiich is what should be visible in the native run of the application. I then use the same variable (it is designated as a global variable or a property) in the on choose menu item handler, so that if the user selects a different item in the popup list, the value of the variable is updated to reflect that selection.

I hope this helps,

Hi,

You can also check some of the recent post exchanges in bbs.applescript.net/viewtopic.php?id=19063. I am sure it’ll help.

In particular, note the suggested methods from jobu. It should be quite straightforward to apply them to your problem.

Good luck!

archseed :slight_smile:

Thank you both, the problem is fixed. Actually I’m completely done my program :slight_smile: (Thanks to LOTS of help from people here)