Re: Yosemite and activate failures
Re: Yosemite and activate failures
- Subject: Re: Yosemite and activate failures
- From: Shane Stanley <email@hidden>
- Date: Wed, 11 Mar 2015 22:36:57 +1100
- Sun-java-system-smtp-warning: Lines longer than SMTP allows found and truncated.
On 11 Mar 2015, at 7:21 pm, Jörgen Stahle <email@hidden> wrote:The answer from Apple : ”This issue behaves as intended based on the following:
Each ‘tell’ sends an AppleEvent, asynchronously, and when Finder or our own app receive that event they do a SetFrontProcess() on themselves. So, depending on which order they actually get received and handled, either Finder or the current app could get be in front.
If you change the script so that it has to get something back from Finder, thus insuring that Finder has finished processing the activate event
So that would mean like this:
on getFrontmostAppName() tell application "System Events" set frontmostName to item 1 of (get name of processes whose frontmost is true) end tell return frontmostName end getFrontmostAppName
tell application "Finder" activate get window 1 set thisAppName to my getFrontmostAppName() end tell
return thisAppName --> "Script Editor"
What nonsense.
Curiously, though, this now seems to be working here (10.10.2):
tell application "Mail" activate display dialog "Hello" end tell |
_______________________________________________
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