Re: UI scripting, windows order
Re: UI scripting, windows order
- Subject: Re: UI scripting, windows order
- From: nino <email@hidden>
- Date: Tue, 21 Jan 2003 13:27:17 +0100
>
Just looking at your examples, it's interesting that the two that address
>
System Events report the "Test 1" file last in the list. There is a bug in
>
TextEdit that causes it to report a weird file name for saved TextEdit
>
documents -- the real file name is followed by some spaces, an illegal
>
character (illegal to AppleScript, anyway), and the file path. I wonder if
>
the illegal character is causing System Events to fail to parse the rest of
>
the files once it sees the bad TextEdit file name, thus leaving out "Senza
>
titolo 2" in your second snippet.
Hi Bill,
I don't think the weird window naming is a TextEdit bug, the same thing
happens with Safari, so probably it is a Cocoa standard and we have to get
used to extract document name from window names using TIDs.
As for the character it is a legal one for applescript but transformed by
the mail system, kind of long "-".
But the point that I would like to rise is the fact that there is, as far as
I understand, no way in the GUI scripting to address the front window in a
reliable way. This has always been done addressing the "window 1" object.
>
As to front-to-back ordering, I believe the System Events GUI Scripting
>
feature treats file indexes differently than the traditional AppleScript
>
usage. GUI Scripting is based directly on the new accessibility API; it
>
indexes windows in order of creation date, and it appears that an index
>
remains associated with the same file throughout its existence in order to
>
meet the needs of assistive applications. We may just have to get used to
>
the idea that GUI Scripting indexes are more like persistent unique IDs than
>
front-to-back ordering indicators.
That may be the case, but creation order is useless information in terms of
scripting, doesn't tell anything about the window in front, the one that is
getting events.
I hope someone at Apple will comment on this subject and that other people
try GUI scripting on application with multiple windows opened triyng to
figure out from the script what window get their commands.
I can be completely wrong and missed the solution, but if I'm right and this
is not my computer problem then it is a very serious bug that will make
almost impossible to invoke scripts on opened applications.
nino
_______________________________________________
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.