>>183
×
tell application "System Events" to set activeApp to name of application processes whose frontmost is true

tell application "System Events" to set activeApp to item 1 of (get name of application processes whose frontmost is true)