tell application "Finder" to name of some process whose frontmost is true
tell me to display dialog the result as text
If I run it from Smile, it correctly tells me that Smile is the frontmost application.
If I run it from the script menu, it ALWAYS tells me that System Events is frontmost.
I'm running OS 10.4.3. Is this true of earlier versions of the OS?
What I want, of course, is the application name that appears in the menu bar.
A direct approach to getting this ought to be as easy as something like ...
name of menu item 2 of menu bar
Does anyone know of any documents that explain how to do this?