• 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: Ray Robertson <email@hidden>
  • Date: Fri, 16 Jan 2015 14:59:22 -0500
  • Sun-java-system-smtp-warning: Lines longer than SMTP allows found and truncated.

Running Chris’s script under Yosemite also gives me the wrong results. It works fine, as he stated, under Mavericks.

To be clear: I’m running these from a script saved as an application. For my use, that is crucial as I have many applets which end with “tell me to activate” and then immediately display a dialog. In Yosemite, the applet is not brought forward, and I get the bouncing dock icon.

Those of you getting the name of an editor are obviously running from an editor. It is interesting to see that some scripts are failing from there as well. We all know using delay is a method of last resort, and in this case it appears to be even less reliable.

For now, I will need to use System Events combined with Shane’s AS/ObjC to make activate work like it should—activate the application, and then wait until it is in front before proceeding with any other commands. For Yosemite users only, of course. I’ve posted the complete test below just FYI.  You could put the “path to” and posix coercion in the subroutine, but you would need to add a condition to handle “path to me”.

Jörgen asked…

What do you guess: Will Apple do something about it quite soon?

I’m only guessing. But I would agree with Shane’s guess that this is likely a change to the underlying behavior system-wide. As such, we could be waiting a long time on a fix. Let’s hope not. I have filed a feedback report, and will leave a bug report as well for good measure.

Ray Robertson

---------
use scripting additions
use framework "Foundation"

set appNameReportText to ""
tell application "Finder"
my activateAppAtPath:(POSIX path of (path to application "Finder"))
set thisAppName to my getFrontmostAppName()
end tell
set appNameReportText to appNameReportText & thisAppName & return

tell application "Mail"
my activateAppAtPath:(POSIX path of (path to application "Mail"))
set thisAppName to my getFrontmostAppName()
end tell
set appNameReportText to appNameReportText & thisAppName & return


my activateAppAtPath:(POSIX path of (path to me))
set thisAppName to my getFrontmostAppName()
set appNameReportText to appNameReportText & thisAppName & return
tell me to activate
tell current application
display dialog appNameReportText
end tell

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

on activateAppAtPath:appPosixPath
set theNSBundle to current application's NSBundle's bundleWithPath:appPosixPath
set processName to (theNSBundle's objectForInfoDictionaryKey:"CFBundleName") as text
tell application "System Events" to tell process processName
set frontmost to true
end tell
end activateAppAtPath:




 _______________________________________________
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: Deivy Petrescu <email@hidden>
    • Re: Yosemite and activate failures
      • From: Yvan KOENIG <email@hidden>
References: 
 >Script that "Tells" Finder just Focuses on Finder instead of running (From: Alex Hall <email@hidden>)
 >Re: Script that "Tells" Finder just Focuses on Finder instead of running (From: Deivy Petrescu <email@hidden>)
 >Re: Script that "Tells" Finder just Focuses on Finder instead of running (From: 2551 <email@hidden>)
 >Re: Script that "Tells" Finder just Focuses on Finder instead of running (From: Alex Hall <email@hidden>)
 >Re: Script that "Tells" Finder just Focuses on Finder instead of running (From: Deivy Petrescu <email@hidden>)
 >Re: Script that "Tells" Finder just Focuses on Finder instead of running (From: Shane Stanley <email@hidden>)
 >Re: Script that "Tells" Finder just Focuses on Finder instead of running (From: Deivy Petrescu <email@hidden>)
 >Re: Script that "Tells" Finder just Focuses on Finder instead of running (From: Shane Stanley <email@hidden>)
 >Re: Script that "Tells" Finder just Focuses on Finder instead of running (From: Deivy Petrescu <email@hidden>)
 >Re: Script that "Tells" Finder just Focuses on Finder instead of running (From: Shane Stanley <email@hidden>)
 >Re: Script that "Tells" Finder just Focuses on Finder instead of running (From: Shane Stanley <email@hidden>)
 >Re: Script that "Tells" Finder just Focuses on Finder instead of running (From: Yvan KOENIG <email@hidden>)
 >Re: Script that "Tells" Finder just Focuses on Finder instead of running (From: Shane Stanley <email@hidden>)
 >Re: Script that "Tells" Finder just Focuses on Finder instead of running (From: Yvan KOENIG <email@hidden>)
 >Re: Script that "Tells" Finder just Focuses on Finder instead of running (From: Shane Stanley <email@hidden>)
 >Re: Script that "Tells" Finder just Focuses on Finder instead of running (From: Alex Hall <email@hidden>)
 >Re: Yosemite and activate failures (From: Christopher Stone <email@hidden>)

  • Prev by Date: Re: Yosemite and activate failures
  • Next by Date: Re: Yosemite and activate failures
  • Previous by thread: Re: Yosemite and activate failures
  • Next by thread: Re: Yosemite and activate failures
  • Index(es):
    • Date
    • Thread