on run display dialog frontmost_app() end run on frontmost_app() set front_app to (path to frontmost application as Unicode text) set atid to (AppleScript's text item delimiters) set AppleScript's text item delimiters to ":" set front_app to (front_app's text items) set AppleScript's text item delimiters to atid set front_app to reverse of rest of reverse of front_app return last item of front_app end frontmost_app