2 MainMenu in Application

Hi Folks,

I have to Menus in my Application - does anybody has a clue how to enable/disable one of them?

f.ex:



if x is 1 then
set enabled of menu 1 to false
set enabled of menu 2 to true
else if x is 2 then
set enabled of menu 1 to true
set enabled of menu 2 to false
end if

error is: can`t make <<class enaB>> of <<class mene>> "1" into type reference. (-1700)

Thanks for your help!

BR

Stefan





The error says “reference is missing”, you have to specify the menu
If your variable x has only the states 1 and 2, you can simplify the code like this

tell menu "myMenu"
	set enabledMenu2 to (x - 1) as boolean
	set enabled of menu 2 to enabledMenu2
	set enabled of menu 1 to not enabledMenu2
end tell