Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using name key form with menus



I think I've found the answer for
display alert ((title of (menu item 1 of menu "appMenu" of main menu)) as string)

I was calling the NSMenuItem appMenu instead of the NSMenu class. I was confused as to which to name because it was the NSMenuItem that had the index that worked (menu 1) whereas the NSMenu class always has an index of 0. So it looks like menus within menus are also menu items, and it's the index of NSMenuItem that works, and the name of the NSMenu. Bit confusing.

What threw me even more is that giving the main menu a name still doesn't work, but giving other menus names does, so it stopped most of my test and examples from working. bleh. But I guess I can always use main menu for that.

Thank you for your help.

Fergal



On 18 May 2008, at 12:20, Benjamin Dobson wrote:

System info please. Works for me on Leopard/Xcode3.1
display alert ((title of (menu item 1 of menu "appMenu" of main menu)) as string)

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Studio mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/email@hidden

This email sent to email@hidden

References: 
 >Using name key form with menus (From: Fergal Hainey <email@hidden>)
 >Re: Using name key form with menus (From: Fergal Hainey <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.