# Saved as an applet named testeur2.app
tell application "TextEdit"
activate
delay 0.5
set curName to name of current application
# I assumed that it will return "TextEdit" but it returns
--> testeur2
end tell
tell application "System Events"
set frontName to name of first process whose frontmost is true
# I assumed that it will return "TextEdit" and it returns
--> TextEdit
end tell
tell application "SystemUIServer" to display dialog "msg1 : " & return & curName & return & frontName
(*
msg1 :
testeur2
TextEdit
*)
tell me
activate
delay 0.5
set curName to name of current application
# I assumed that it will return "Testeur2" and it returns
--> testeur2
end tell
delay 0.5
tell application "System Events"
set frontName to name of first process whose frontmost is true
# I assumed that it will return "Testeur2" but it returns
--> TextEdit
end tell
tell application "SystemUIServer" to display dialog "msg2 : " & return & curName & return & frontName
(*
msg2 :
testeur2
TextEdit
*)