• 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: 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
  • Follow-Ups:
    • Re: frontmost in Leopard vs Tiger
      • From: Luther Fuller <email@hidden>
    • Re: frontmost in Leopard vs Tiger
      • From: Bill Cheeseman <email@hidden>
References: 
 >frontmost in Leopard vs Tiger (From: Luther Fuller <email@hidden>)

  • Prev by Date: (OT) Los Angeles area InDesign Scripters?
  • Next by Date: Re: frontmost in Leopard vs Tiger
  • Previous by thread: frontmost in Leopard vs Tiger
  • Next by thread: Re: frontmost in Leopard vs Tiger
  • Index(es):
    • Date
    • Thread