• 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: Mail GUI script error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mail GUI script error


  • Subject: Re: Mail GUI script error
  • From: "William J. Cheeseman" <email@hidden>
  • Date: Wed, 20 Feb 2013 10:51:17 -0500


On Feb 20, 2013, at 10:25 AM, Luther Fuller <email@hidden> wrote:

Since the error was originating from Mail, I added an 'activate' before setting-up Mail.
Like this ...

activate me -- added. No -1719 error
tell application "Mail"
activate

This seems to solve my problem. It worked the first time I tested it.

Now, the problem is that I don't understand why this should work.

Activating the target application before sending GUI Scripting commands to System Events is common practice. This is consistent with the fundamental assumption of the accessibility API (on which GUI Scripting is based), namely, that accessibility commands should not do anything that a user cannot do directly in the application's UI. We can't normally manipulate an application's UI unless it is the active application. 

I have found that some applications are written in such a way that telling them to make changes to their UI doesn't work unless the application is active. Apparently Mail is one of them.

-- 

Bill Cheeseman - email@hidden

 _______________________________________________
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: 
 >Mail GUI script error (From: Luther Fuller <email@hidden>)
 >Re: Mail GUI script error (From: Brian Christmas <email@hidden>)
 >Re: Mail GUI script error (From: Luther Fuller <email@hidden>)
 >Re: Mail GUI script error (From: Brian Christmas <email@hidden>)
 >Re: Mail GUI script error (From: Luther Fuller <email@hidden>)

  • Prev by Date: Re: Mail GUI script error
  • Next by Date: Rép: Mail GUI script error
  • Previous by thread: Re: Mail GUI script error
  • Next by thread: Re: Mail GUI script error
  • Index(es):
    • Date
    • Thread