• 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: Identifying the frontmost application from a script saved as an application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Identifying the frontmost application from a script saved as an application


  • Subject: Re: Identifying the frontmost application from a script saved as an application
  • From: Luther Fuller <email@hidden>
  • Date: Sun, 16 May 2010 12:23:45 -0500

On May 16, 2010, at 11:15 AM, Yvan KOENIG wrote:

The required one is :
tell application "System Events" to set path2frontmostApp to (path to frontmost application)

I've got a problem with that, at least in Snow Leopard. The command ...

path to frontmost application

isn't a System Events command. It belongs to Standard Additions.

You can do this, however ...

tell application "System Events"
set frontAppl to (name of (some process whose frontmost is true)) as text
end tell
path to application frontAppl

'frontmost' is a property in System Events that applies to applications and processes among other things.
But, you have to know the name of the application in order to set/get it's 'frontmost' property.
You can NOT use: 

tell application "System Events"
set frontAppl to (name of (some application whose frontmost is true)) as text
end tell


 _______________________________________________
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

References: 
 >Rép: Identifying the frontmost application from a script saved as an application (From: Yvan KOENIG <email@hidden>)

  • Prev by Date: Rép: Identifying the frontmost application from a script saved as an application
  • Next by Date: Applescript for XCode fails: error -1728, group can't be accessed
  • Previous by thread: Rép: Identifying the frontmost application from a script saved as an application
  • Next by thread: Applescript for XCode fails: error -1728, group can't be accessed
  • Index(es):
    • Date
    • Thread