Re: UI scripting question
Re: UI scripting question
- Subject: Re: UI scripting question
- From: Bill Cheeseman <email@hidden>
- Date: Fri, 18 Jul 2008 10:20:47 -0400
- Thread-topic: UI scripting question
on 2008-07-18 9:46 AM, Jim Brandt at email@hidden wrote:
> I'm running Safari 3.1.2 on OS X 10.4.11 on a dual 450 PowerPC.
> Leopard isn't an option.
I can no longer test on 10.4.
> With UI Browser, the path to the landscape button shows as:
>
> PATH TO ELEMENT:
> application "Safari"
> standard window "Jim's Place" (window 1)
> Sheet "Page Setup" (sheet 1)
> [MISMATCH] radio group (radio group -2147483648)
> button "" (button 2)
That "[MISMATCH]" flag might be the problem. It is intended to signify that
the target application has a "parent-child mismatch" in this UI element
hierarchy. In other words, the child of an element thinks it has some other
parent, or vice versa. However, it appears that UI Browser 2.0.5 may be
reporting some false negatives in this regard, so I can't be sure a true
parent-child mismatch in Safari is the problem you're experiencing. (I'm
looking into fixing any false negatives for UI Browser 2.1.)
> I've tried this:
>
> tell application "System Events"
> tell process "Safari"
> click menu item "New Window" of menu 1 of menu bar item "File" of
> menu bar 1
> delay 1
> click menu item "Page SetupĀ" of menu 1 of menu bar item "File" of
> menu bar 1
> click button 2 of radio group of sheet 1 of front window
> keystroke return
> end tell
> end tell
>
> The page setup dialog comes up but it doesn't change to landscape mode.
> if I use:
> click button 2 of radio group 1 of sheet 1 of front window
> I get a System Events error.
>
> Am I just out of luck on this one?
What is the System Events error? If it's that a button with index 2 doesn't
exist, or words to that effect, then perhaps the Page Setup sheet hasn't had
time to come up. Try inserting 'delay 1' before the 'click button 2 ...'
statement.
> BTW, OT, is there a way to capture the text in the Screen Reader
> window of UI Browser?
Yes, sort of. With UI Browser's screen reader open and the mouse hovering
over the desired target UI element, hold down the Command key (this freezes
the screen reader on the current UI element) and [Command-]click the Find in
Browser button. The main UI Browser window will come back into view with the
desired target UI element selected. Release the Command key, and choose View
> Report in the menu bar (or choose File > Print Report if you want hard
copy). As an alternative to using the screen reader's Find in Browser
button, you can use the hot key (Cmd-Ctrl-A or Cmd-Ctrl-S) to select the UI
element under the mouse, then View or Print the report.
I should add View Report and Print Report buttons to the screen reader. I'll
do that for UI Browser 2.1. (Unfortunately for you, however, 2.1 will
require Leopard.)
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
www.quecheesoftware.com
PreFab Software - www.prefabsoftware.com
_______________________________________________
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