Seting The State Of A Menu

I’m having trouble setting the state of a menu i have tried

set state of menu item "Fred" of sub menu "Using" of sub menu "Speech" of main menu to 0

and that did not work.

Mr. Gecko

Hi Mr. Gecko,

try something like this

set state of menu item "Fred" of menu "Using" of sub menu of menu item "Speech" of main menu to 0

to parse the menus, Apple’s sample script from the documentation is very helpful
The following script statements, taken from a script running in the Script Editor application, target the menus of a simple AppleScript Studio application. You can use similar statements within an AppleScript Studio application script, though you won’t need the tell application statement.

tell application "TestApp"
    first menu -- result: main menu of application "TestApp"
    title of main menu -- result: "MainMenu"
    menu items of main menu -- result: a list of menu items
    title of menu items of main menu
    -- result: {"", "File", "Edit",  "Window", "Help"}
    menus of main menu -- result: long list
    -- {sub menu of menu item id 1 of main menu of application
         "TestApp", etc. }
    menu items of sub menu of menu item id 1 of main menu 
        -- result: a long list
end tell

Thanks It Works