Hello
As I got the described results with the original script, I edited it this way :
set appNameReportText to "" tell application "Finder" activate set thisAppName to my getFrontmostAppName() end tell set appNameReportText to appNameReportText & thisAppName & return say thisAppName
tell application "Mail" activate set thisAppName to my getFrontmostAppName() end tell set appNameReportText to appNameReportText & thisAppName & return say thisAppName
tell me to activate tell current application activate set thisAppName to my getFrontmostAppName() say thisAppName set appNameReportText to appNameReportText & thisAppName & return
end tell tell application "SystemUIServer" to display dialog appNameReportText
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 ----------------
I got the correct application names. As I am curious, I replaced the three instructions:
say thisAppName
by
With this new version I retrieved the original behaviour. As My curiosity has no end, I retried with three instructions :
and this time I got the correct result.
This result let me think that there is a problem of delay. So I replaced the three say " " instructions by three
With this version I got also the correct result.
As my family wait for the dinner, I don't make more tests but it seems that the problem is really a delay one.
Yvan KOENIG (VALLAURIS, France) jeudi 15 janvier 2015 20:44:35
|