• 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: Process whose frontmost *was* true?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Process whose frontmost *was* true?


  • Subject: Re: Process whose frontmost *was* true?
  • From: Graff <email@hidden>
  • Date: Mon, 24 May 2004 03:03:36 -0400

You tried doing this?
----
tell application "Finder"
every process whose frontmost is true
end tell
----

When I run that from Script Editor I get:

{application process "Script Editor" of application "Finder"}


If I do this:
----
tell application "OmniWeb"
activate
end tell

tell application "Finder"
every process whose frontmost is true
end tell
----

I get:

{application process "OmniWeb" of application "Finder"}


However, if you do this:
----
tell application "Finder"
activate
every process whose frontmost is true
end tell
----

Then the Finder activates, becomes frontmost and returns:

{application process "Finder" of application "Finder"}

- Ken

On May 24, 2004, at 1:02 AM, Jeff Porten wrote:

First, apologies. I'm sure I've seen this discussed before, but I can't find it in a fulltext search of AS-Users, or in Google efforts. If my answer is easily found by a search I forgot to try, consider the wet noodle already applied in 30 lashes.

I have an AppleScript that I'm calling with a keystroke (via Key Xing, a discontinued SysPrefs hot-key app), and which I want to branch into different functions depending on what application is frontmost. Testing works fine by manually activating an app, and telling System Events to return the process whose frontmost is true.

But when I run the script in real usage, the frontmost app is Key Xing Listener. And I don't see a secondmost boolean.... I've tried telling Key Xing Listener to hide, but since it's faceless, no dice. I've also tried a delay (on the theory that the Listener just needed a second to get out of the way), but further lack of dice resulted.

My rummage through AS-Users found a command to tell the Finder to return a frontmost, which looked promising until it always returned "Finder".

My gut says I'm complexifying this -- what am I missing?
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Process whose frontmost *was* true?
      • From: Jeff Porten <email@hidden>
References: 
 >Process whose frontmost *was* true? (From: Jeff Porten <email@hidden>)

  • Prev by Date: Process whose frontmost *was* true?
  • Next by Date: Mail Delivery (failure email@hidden)
  • Previous by thread: Process whose frontmost *was* true?
  • Next by thread: Re: Process whose frontmost *was* true?
  • Index(es):
    • Date
    • Thread