• 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
Re: Frontmost app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Frontmost app


  • Subject: Re: Frontmost app
  • From: Paul Richardson <email@hidden>
  • Date: Thu, 16 Jan 2003 21:19:38 +0100

On Donnerstag, 16. Januar 2003 20:37:59 Uhr, Steve Roy wrote:

> Is there a better way to tell the frontmost app to do something than the
> following?
>
> tell getFrontApplication() to display dialog "Hello"
>
> on getFrontApplication()
> tell application "Finder"
> set theList to name of every process whose frontmost is true
> end tell
> return application (theList as string)
> end getFrontApplication

More concise, I think it's faster, but is it better?

---

tell getFrontApplication() to display dialog "Hello"

on getFrontApplication()
tell application "System Events"
return first application process whose frontmost is true
end tell
end getFrontApplication

---

--
Paul
_______________________________________________
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.

  • Prev by Date: gui scripting
  • Next by Date: Re: Frontmost app
  • Previous by thread: Re: Frontmost app
  • Next by thread: Re: Frontmost app
  • Index(es):
    • Date
    • Thread