• 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 in Leopard vs Tiger
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: frontmost in Leopard vs Tiger


  • Subject: Re: frontmost in Leopard vs Tiger
  • From: Luther Fuller <email@hidden>
  • Date: Fri, 25 Jul 2008 15:34:06 -0500

I found the workaround yesterday. Yes, there is a problem with System Events in Tiger. The line of code I referred to MUST be executed before any other call to System Events is made. So I moved the line two lines up, so that it's the first line, and assigned it to a variable. Problem gone.

On Jul 25, 2008, at 2:11 PM, Christopher Nebel wrote:

On Jul 24, 2008, at 5:35 PM, Luther Fuller wrote:

I've run into a problem with a single line of code in "MyApplication".

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

"MyApplication" is written and compiled in Leopard as a faceless background application (LSUIElement = 1). It ought to run on Tiger, too. When run in Leopard, the line above returns the name of the application that was frontmost when "MyApplication" was launched.

There is a problem in Tiger. The line of code above returns "MyApplication", which is incorrect.
"MyApplication" does not show in the Dock or Menu bar, but the code above behaves as if it did.

That's a known issue with System Events in Tiger. Technically, your LSUIElement process *is* frontmost -- you can't really tell unless it has a window up, but it's there. Of course, this is not what most people want, so it changed in Leopard to return the frontmost "UI" process -- in other words, the one that owns the currently visible menu bar. "path to frontmost application" returns the frontmost UI process in both Tiger and Leopard.

_______________________________________________ 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: 
 >frontmost in Leopard vs Tiger (From: Luther Fuller <email@hidden>)
 >Re: frontmost in Leopard vs Tiger (From: Christopher Nebel <email@hidden>)

  • Prev by Date: Re: frontmost in Leopard vs Tiger
  • Next by Date: slash path to alias
  • Previous by thread: Re: frontmost in Leopard vs Tiger
  • Next by thread: changing content in scripted Mail reply: how?
  • Index(es):
    • Date
    • Thread