• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Understanding System Events...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Understanding System Events...


  • Subject: Understanding System Events...
  • From: Jakob Peterhänsel <email@hidden>
  • Date: Fri, 11 Apr 2003 02:01:53 +0200

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
----------------------
Anyone smarter that I am???

Jakob Peterhdnsel

'If you don't have anything nice to say, you just say nothing' - Bambi

Email: email@hidden
AIM: Marook
Phone: +45 40163806
_______________________________________________
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.

  • Follow-Ups:
    • Re: Understanding System Events...
      • From: John Delacour <email@hidden>
    • Re: Understanding System Events...
      • From: Rob Jorgensen <email@hidden>
  • Prev by Date: Re: Mounting Windows Drives
  • Next by Date: HTTP POST multipart/form-data?
  • Previous by thread: Re: Resource fork, PICT, and OS X
  • Next by thread: Re: Understanding System Events...
  • Index(es):
    • Date
    • Thread