Re: menu bar 1 in 10.8?
Re: menu bar 1 in 10.8?
- Subject: Re: menu bar 1 in 10.8?
- From: LuKreme <email@hidden>
- Date: Thu, 27 Jun 2013 05:45:53 -0600
On 27 Jun 2013, at 05:08 , Mads Fog Albrechtslund <email@hidden> wrote:
> activate application "Mail"
> tell application "System Events"
> tell process "Mail"
> click menu item "Add Account…" of menu 1 of menu bar item "File" of menu bar 1
> end tell
> end tell
That works. How are you supposed to figure out menu 1?
What, exactly is "menu 1" is that just the entire Mail menu? or is that saying it's the "top level" of the file menu? So, for example, how would you click View => Sort by => Date or Format => Lists => Insert Bulleted List?
get name of menu bar items of menu bar 1
=> {"Apple", "Mail", "File", "Edit", "View", "Mailbox", "Message", "Format", "Window", "Help"}
This certainly made me thing that menu bar item "File" was the next level below menu bar 1, but Tryng to get the items in File"
get name of menu bar items of menu bar item "File" of menu bar 1
get name of menu items of menu bar item "File" of menu bar 1
get name of menu bar items of menu 1 of menu bar item "File" of menu bar 1
all give a result of {}
So there seems to be no way to discover the absolutely critical "menu 1"
get name of menu items of menu 1 of menu bar item "File" of menu bar 1
{"New Message", "New Viewer Window", "Open Message", missing value, "Close", "Close All Windows", "Save", "Save As…", "Save as Stationery…", missing value, "Attach Files…", "Save Attachments…", "Quick Look Attachments", missing value, "Add Account…", "Import Mailboxes…", missing value, "Print…"}
On 27 Jun 2013, at 05:14 , Bill Cheeseman <email@hidden> wrote:
> The first two lines should be
>
> tell application "System Events"
> tell process "Mail"
The issue was the lack of menu 1. I tried many different variations and ended up posting one without "process", but mostly what I was trying was along the lines of
tell application "System Events" to tell process "Mail"…
But I kept changing things as I could never get it to work, not knowing about menu 1.
--
What if there were no hypothetical questions?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden