Getting the Frontmost Process's Name from the Script Menu
Getting the Frontmost Process's Name from the Script Menu
- Subject: Getting the Frontmost Process's Name from the Script Menu
- From: "Jonathan Levi, M.D." <email@hidden>
- Date: Sun, 26 Aug 2007 01:42:43 -0400
Please excuse a newbie-oid question: How to write an AppleScript that
will get the frontmost process's name when run from the Script Menu?
For instance,
tell application "System Events" to set frontProcNameList to (name of
application processes whose frontmost is true)
set frontProcName to item 1 of frontProcNameList
tell application frontProcName to display dialog frontProcName
gives Script Editor if run as a script, but System Events when run
from the Script Menu, regardless of what application appears to be
active (name showing in upper left corner of screen, gets keystrokes,
etc.) If the same script is saved as an application and run from the
Script Menu, it gives its own name, even if it appears to be in the
background. (Doing the same thing with the Finder instead of System
Events makes no difference.) Any help?
Thanks,
Jonathan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden