Re: UI scripting, windows order
Re: UI scripting, windows order
- Subject: Re: UI scripting, windows order
- From: Bill Cheeseman <email@hidden>
- Date: Mon, 20 Jan 2003 09:27:16 -0500
on 03-01-19 1:30 PM, nino at email@hidden wrote:
>
I'm addressing TextEdit directly and via UI scripting, I've 3 windows opened
>
created in the order "Senza Titolo", "Senza Titolo 2" and "Test1" that is a
>
file, then took "Senza Titolo 2" as the front window.
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.
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.
Hopefully, someone from Apple might fill us in on the latter question. It's
important to know whether the indexing scheme in GUI Scripting will change
in the future. Bearing in mind that this is beta software.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
The AppleScript Sourcebook -
http://www.AppleScriptSourcebook.com
Vermont Recipes -
http://www.stepwise.com/Articles/VermontRecipes
Croquet Club of Vermont -
http://members.valley.net/croquetvermont
_______________________________________________
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.