• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: menu bar 1 in 10.8?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: menu bar 1 in 10.8?


  • Subject: Re: menu bar 1 in 10.8?
  • From: Mads Fog Albrechtslund <email@hidden>
  • Date: Thu, 27 Jun 2013 13:08:37 +0200

On 27/06/2013, at 13.00, LuKreme <email@hidden> wrote:

> Is there a change in System Events GUI scripting recently?
>
> tell application "Mail"
>  tell application "System Events"
>    click menu item "Add Account" of menu 1 of menu bar item "File" of menu bar 1
>  end tell
> end tell
>
> => error "System Events got an error: Can’t get menu bar 1." number -1728 from menu bar 1
>
> I also tried this:
>
> tell application "Mail"
>  tell application "System Events"
>    tell menu bar 1
>      tell menu "File"
>        click menu item "Add Account"
>      end tell
>    end tell
>  end tell
> end tell
>
> With the same results.


This works for me, in OS X 10.8.4

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

/Mads Fog Albrechtslund

 _______________________________________________
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


References: 
 >menu bar 1 in 10.8? (From: LuKreme <email@hidden>)

  • Prev by Date: menu bar 1 in 10.8?
  • Next by Date: Re: menu bar 1 in 10.8?
  • Previous by thread: menu bar 1 in 10.8?
  • Next by thread: Re: menu bar 1 in 10.8?
  • Index(es):
    • Date
    • Thread