popup button's menu item to enabled false ?

Hello,
can’t find a way to grey out some menu items in a popup button…
I want some items of a popup button to be disabled when user choose some items from another popup menu.

i.e.

popup button one popup button two

item 1 item 1 enabled, item 2 & 3 disabled

item 2 item 1 disabled, item 2 & 3 enabled

tried with :
on will pop up theObject
on action theObject

with syntax :
set enabled of menu item id 1 of menu of popup button popup_1 of window main_window to false

with no luck… is that possible ? how should I do it ?

after several truning around i found the right syntax :

set enabled of menu item applescript_item_index_number of popup button “popup_1” of window “main_menu” to false

where applescript_item_index_number is typed without quotes.
worked with the
on will pop up

:slight_smile:

So it works but i guess there is a bug because :

first it didn’t work at all
second it begins to work after applying these several steps (which don’t make sense) :

a) in IB choose the menu item you want to script
b) go into the applescript info box and click on “update menu item” (under the menu entry)
c) click on your script name to activate scripting for the menu item
d) save
e) doh?!! not working ? let’s go on the next steps :slight_smile:
f) click again on your script name to deactivate it (note that the “update menu item” is still checked)
g) save

pretty odd but it’s working this way… at least for me it’s working now… i’m using XCode with last update applied.

Hope it will help some of you :wink: