Re: frontmost in Leopard vs Tiger
Re: frontmost in Leopard vs Tiger
- Subject: Re: frontmost in Leopard vs Tiger
- From: Christopher Nebel <email@hidden>
- Date: Fri, 25 Jul 2008 12:11:06 -0700
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.
--Chris Nebel
AppleScript Engineering
_______________________________________________
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