Re: Understanding System Events...
Re: Understanding System Events...
- Subject: Re: Understanding System Events...
- From: Rob Jorgensen <email@hidden>
- Date: Thu, 10 Apr 2003 20:37:11 -0400
At 2:01 AM +0200 4/11/03, Jakob Peterhdnsel wrote:
Hi All.
Ok, I'm trying to get the name of the frontmost application.
This code does not work-Why?:
----------------------
tell application "System Events"
get name of (application process where frontmost is true)
end tell
----------------------
or:
----------------------
tell application "System Events"
get name of (application process whose frontmost is true)
end tell
----------------------
Using only 'process' and not 'application process' does not matter...
This code does work, but the repeat... seems to be just a little
overhead, if you ask me..
----------------------
tell application "System Events"
repeat with i from 1 to (count of processes)
if (frontmost of process i) then
set frontmostApp to name of process i
exit repeat
end if
end repeat
end tell
----------------------
This works for me (OS X 10.2.5 and System Events 1.2 beta):
tell application "System Events"
item 1 of (get name of processes whose frontmost is true)
end tell
--
Rob Jorgensen
Ohio, USA
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.