Re: Determining frontmost application in OS X
Re: Determining frontmost application in OS X
- Subject: Re: Determining frontmost application in OS X
- From: bryan <email@hidden>
- Date: Thu, 18 Jul 2002 18:23:06 -0400
So, now "...whose..." is working but "items of..." isn't?
When did that happen? I made the 'mistake' of upgrading from
10.1.2b3 to 10.1.5 and broke my scripts.
I tried going back to 10.1.2b3 with no luck.
Anybody have any ideas?
Bryan Kaufman
Christopher Nebel wrote:
>
On Thursday, July 18, 2002, at 05:32 AM, email@hidden
>
wrote:
>
>
> The question is, how to figure out which application is the frontmost
>
> one. Telling the Finder to get the processes gives me a list, but the
>
> first item in the list is always "loginwindow."
>
>
>
> tell application "Finder"
>
> get the name of every process
>
> end tell
>
>
>
> (result below)
>
> {"loginwindow", "Finder", "AEServer", "Dock", "SystemUIServer",
>
> "PhotoStickies", "MooSB", "Show Desktop", "Key Xing Listener", "Palm
>
> Desktop Background", "Transport Monitor", "MoonMenuXBackgrounder", "ASM
>
> Controller", "System Events", "Mail", "SecurityAgent", "Internet
>
> Explorer", "System Preferences", "Script Editor"}
>
>
>
> Can I get this list sorted "front to back?"
>
>
If you want the last item of the list, you could say "last item of
>
the_list" or "item -1 of the_list" (negative indicies go from the end).
>
The problem is, that won't tell you the frontmost one, because that's
>
not how the list is ordered. It's actually not specified what order the
>
processes are in, but it happens (currently) to be in launch order, so
>
the last one is the most recently launched.
>
>
Fortunately, processes have a "frontmost" property. If you substitute
>
"get the name of processes whose frontmost is true", you should get a
>
list of one string, e.g. {"Mail"}.
>
>
--Chris Nebel
>
AppleScript Engineering
>
_______________________________________________
>
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.
[demime 0.98b removed an attachment of type text/x-vcard which had a name of bryan.vcf]
_______________________________________________
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.