System Events: window id's instead of window names?
System Events: window id's instead of window names?
- Subject: System Events: window id's instead of window names?
- From: Daniel Brown <email@hidden>
- Date: Mon, 21 Jun 2010 19:40:57 -0400
Using System Events, is there any way to get id's of windows instead
of just their names?
I've written a little script to horizontally tile the windows of the
current application, but if multiple windows have the same name then
it only finds one of them and fails to tile properly. Here's the
script:
tell application "Finder"
set {screenWidth, screenHeight} to {item 3, item 4} of (get
bounds of window of desktop)
end tell
tell application "System Events"
set ws to windows of process (name of first process whose
frontmost = true and visible = true)
set {width, height} to {screenWidth / (count ws), screenHeight}
set i to 0
repeat with w in ws
set {position of w, size of w} to {{i * width, 0}, {width, height}}
set i to i + 1
end repeat
end tell
The problem appears to be that the windows given to me by System
Events are identified only by name, not id—I get an error if I ask
`get id of w` in the loop. And the reason that I'm going through
System Events is that I want tiling to work even for non-scriptable
applications.
Is there a way to identify the windows of a non-scriptable application
by id? Or maybe I'm just making a dumb mistake somewhere?
Dan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden