Re: Mail GUI script error
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. |
_______________________________________________
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