How know what window is on focus?
I'm developing a software which needs get list of all windows are open.
To this I'm using the follow script:
tell application "System Events"
set arr to {}
repeat with proc in application processes
tell proc
repeat with win in windows
set arr to arr & {{name of win, size of win, position of win}}
end repeat
end tell
end repeat
return arr
end tell
This script return me:
{{"files", {1483, 746}, {75, 158}}, {"sidneivl Info", {265, 824}, {10, 32}}, {"Apple - Support - Discussions - Post Message: New Topic", {1679, 972}, {0, 22}}, {"Skype™", {315, 822}, {1363, 22}}}
But I need know what window is on focus, what the property say me it?
I tried use frontmost, (set arr to arr & {{name of win, size of win, position of win, frontmost}})
but the front most set true for all windows from the same application, right???
How can I get what window is on top using my code?
I read this topic: http://discussions.apple.com/thread.jspa?messageID=10469903�
but I didn't understand...
well, if someone know how do it I will be glad...
Thanks
Macbook pro, Mac OS X (10.6.2)