re: UI scripting, windows order
re: UI scripting, windows order
- Subject: re: UI scripting, windows order
- From: Charles Arthur <email@hidden>
- Date: Thu, 16 Jan 2003 18:24:31 +0000
On Thu, 16 Jan 2003 16:44:46 +0100, nino <email@hidden> wrote:
>
I've tested this with Textedit and few other applications. If the
>
application targeted with system events has two or more windows opened then
>
window 1 is not necessarily the front window.
>
>
The problem is that windows for system events doesn't have a front property,
>
and apparently the focus property is always false.
>
>
Assume you have opened textedit and created 2 windows "untitled 1" and
>
"untitled 2" with the latter in front, asking system events for
>
name of window 1 of process "textedit"
>
will result "untitled 1".
>
>
Is this a bug?
Funny, I was trying to script TextEdit last night (to add a "count words"
script so that I could invoke it with a keystroke combo via Keyboard
Maestro). I succeeded, not after some wrangling.
The point is one that was made long ago, when 10.1 was young, by Chris
Nebel: the key thing in (Cocoa?) apps like TextEdit is not window, but
document. The window class is separate of the document name (and of the
window index).
However my experience was that the frontmost window was always window 1.
Yours seems to contradict that, which I find odd. Have a go at scripting by
doing something like
set thewin to {}
tell application "TextEdit"
set thecount to count documents
repeat with i from 1 to thecount
set thewin to thewin & properties of document i
end repeat
end tell
thewin
(I discovered, as Chris N had pointed out, that the text of the document is
a property of it. So you count its words. But that's not what you're
looking for now.)
Try replacing "document" with window. This may help to uncover what's going on.
Charles
----------------------------
http://www.ukclimbing.com : 1100+ British crags, 350+ British climbing
walls - searchable by distance and anything else you care to think of -
with weather forecasts for every one, plus maps, articles, news and
features. And there's even a cool shop attached.
________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information on a proactive anti-virus service working
around the clock, around the globe, visit
http://www.messagelabs.com
________________________________________________________________________
_______________________________________________
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.