Re: Getting the Frontmost Process's Name from the Script Menu
Re: Getting the Frontmost Process's Name from the Script Menu
- Subject: Re: Getting the Frontmost Process's Name from the Script Menu
- From: Philip Aker <email@hidden>
- Date: Sun, 26 Aug 2007 01:03:05 -0700
On 2007-08-25, at 22:42:43, Jonathan Levi, M.D. wrote: 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?
You should be able to work from this:
set frapp to path to «constant afdregfp» as string display dialog frapp |
_______________________________________________
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