• 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: Yosemite and activate failures
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

-- 
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>

 _______________________________________________
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

  • Follow-Ups:
    • Re: Yosemite and activate failures
      • From: Ray Robertson <email@hidden>
  • Prev by Date: Re: OffTopic : error reported in Console
  • Next by Date: Re: OffTopic : error reported in Console
  • Previous by thread: Re: OffTopic : error reported in Console
  • Next by thread: Re: Yosemite and activate failures
  • Index(es):
    • Date
    • Thread