• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
re: UI scripting, windows order
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

re: UI scripting, windows order


  • Subject: re: UI scripting, windows order
  • From: nino <email@hidden>
  • Date: Sun, 19 Jan 2003 19:30:16 +0100

Hi,
probably my previous plea for help on this subject was not well explained.

I will add a couple of snippets and their result to make it clear.

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.

Snippet 1: direct

tell application "TextEdit"
get name of window 1
-->"Senza titolo 2"
get name of every window
--> {"Senza titolo 2", "Test1 /Users/nino/Documents", "Senza
titolo"}
end tell

Exactly as expected, except for the name of "Test1" that includes same path
info.

Snippet 2: UI scripting
tell application "System Events"
set frontmost of process "TextEdit" to true
get name of window 1 of process "TextEdit"
--> "Senza titolo 2"
get name of every window of process "TextEdit"
-->{"Senza titolo", "Test1 /Users/nino/Documents"}
end tell

The strange thing is that every window has just 2 elements and excludes the
front window from the list.

Now if I get "Test1" on front and run the script results are
get name of window 1 of process "TextEdit"
--> "Senza titolo"
get name of every window of process "TextEdit"
--> {"Senza titolo", "Senza titolo 2", "Test1
/Users/nino/Documents"}
Got all elements in the list but with wrong order and even window 1 is
mislead

Well everyone can try what happens when changing the windows order.

The same UI script addressing "safari" gives always the window created first
as being on front and the list ordered as created.

Why all this is so important? Well, UI scripting mimics a user interaction
that is accessing, by definition, the front window of front application and
the script should be able to identify it.

Is this particular to those applications or all Cocoa apps, or a bug in
System events beta? I think this is very critical functionality to do almost
anything with it.

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.

  • Follow-Ups:
    • Re: UI scripting, windows order
      • From: Bill Cheeseman <email@hidden>
  • Prev by Date: Re: Routines for review: Hex <-> String
  • Next by Date: Re: Date mathematics help please...
  • Previous by thread: UI scripting, windows order
  • Next by thread: Re: UI scripting, windows order
  • Index(es):
    • Date
    • Thread