I would like to run a script (via the script menu or Key Xing for instance) that should do different things depending on which application is frontmost. However, the classical: tell application “System Events”/if frontmost of process “Safari” is true then… does not work because the the moment the script is run, System Events (or Key Xing) has become the frontmost application. Can this be solved?
Thanks