• 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: path to frontmost application: bug in AS 1.9.3?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: path to frontmost application: bug in AS 1.9.3?


  • Subject: Re: path to frontmost application: bug in AS 1.9.3?
  • From: Paul Berkowitz <email@hidden>
  • Date: Fri, 01 Oct 2004 04:49:57 -0700

Title: Re: path to frontmost application: bug in AS 1.9.3?
On 9/30/04 11:11 PM, "Donald Hall" <email@hidden> wrote:

I have a script with an idle handler containing the following statement:

        set frontProc to name of (info for (path to frontmost application))

In AS 1.9.3, OS 10.3.5, when the screen saver is running this statement does not give the expected result of "ScreenSaverEngine", but rather the name of the application that was frontmost just prior to the screen saver starting. In Jaguar the statement gave the expected result.

In Panther if instead of the above statement I use:

tell application "Finder" to set frontProc to name of every process whose frontmost is true

frontProc is set to "ScreenSaverEngine" as expected.

Is this a bug or a feature?

Is there a time penalty for using the Finder, or is there another way to get the name of the frontmost application?

I suspect that this is related to the documented change (Release Notes) of AppleScript 1.9.2 (OS 10.3):

"
Scripts that use the path to frontmost application command will now get the correct path when run from the Script Menu menu extra. Previously, the command would return the path to System Events. [3084984]

"
By referring to the new implementation as "the correct path" the implication is that the former result  which returned the name of the faceless background application running the script (System Events) should never be considered frontmost even though it was running the script. That makes sense to me. Probably the Screen Saver is also not to be considered frontmost in the sense of a regular application. Or else this was an unintentional result of the change and should be corrected.

As I recall, 'path to current application' will still get you System Events in that context. See what happens if you try 'current application'.

I'm not quite sure why you refer to a "time penalty" for the Finder. Surely it doesn't change if you do nothing for 3 minutes (leaving Screen Saver in place)? It's a difference between the 'frontmost application ' determined by the standard addition and frontmost process determined by the Finder. (You probably should be using System Events, not the Finder, to get the frontmost process in any case.) Maybe there's meant to be a difference, or maybe one of them is wrong.

--
Paul Berkowitz
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >path to frontmost application: bug in AS 1.9.3? (From: Donald Hall <email@hidden>)

  • Prev by Date: Re: Subject: Scripting QuarkXPress Books
  • Next by Date: Re: activate only one window
  • Previous by thread: path to frontmost application: bug in AS 1.9.3?
  • Next by thread: Re: path to frontmost application: bug in AS 1.9.3?
  • Index(es):
    • Date
    • Thread