Determining frontmost application in OS X
Determining frontmost application in OS X
- Subject: Determining frontmost application in OS X
- From: email@hidden
- Date: Thu, 18 Jul 2002 12:32:09
How can I test for the name of the frontmost application in OS X?
I have window-resizing scripts for Explorer 5 and Apple's Mail app, and they are completely different. However, I think I can do something like this (pseudo code):
if the frontmost application is "Explorer" then
(do the Explorer resize stuff)
end if
if the frontmost application is "Mail" then
(do the Mail resize stuff)
end it
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?"
Thanks for your help.
_______________________________________________
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.