Oops, I'm wrong.
What I described as the correct result is in fact :
testeur (which is the name of the applet) Finder Mail
So, It's not the normal one.
I made an other attempt with :
set appNameReportText to "" tell application "Finder" activate set thisAppName to my getFrontmostAppName() end tell set appNameReportText to appNameReportText & thisAppName & return
tell application "Mail" activate set thisAppName to my getFrontmostAppName() end tell set appNameReportText to appNameReportText & thisAppName & return
say (name of me) tell me activate say (get name of current application) set thisAppName to my getFrontmostAppName() set appNameReportText to appNameReportText & thisAppName & return end tell tell application "SystemUIServer" to display dialog appNameReportText
on getFrontmostAppName() delay 0.1 tell application "System Events" set frontmostName to item 1 of (get name of processes whose frontmost is true) end tell
return frontmostName end getFrontmostAppName
This time, the script said twice : testeur and the displayed list was : Finder Mail Mail
My understanding is that as it has so graphical interface, the script's process is not seen as the frontmost one.
Yvan KOENIG (VALLAURIS, France) jeudi 15 janvier 2015 21:06:28
|