Re: UI scripting question
Re: UI scripting question
- Subject: Re: UI scripting question
- From: Axel Luttgens <email@hidden>
- Date: Sat, 19 Jul 2008 10:23:27 +0200
Le 18 juil. 08 à 15:46, Jim Brandt a écrit :
Bill,
Thanks for the reply.
I'm running Safari 3.1.2 on OS X 10.4.11 on a dual 450 PowerPC.
Leopard isn't an option.
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)
Yes, it seems that there something wrong with that radio group; the
problem is shown, though indirectly, with Xcode's "Accessibility
Inspector" as well.
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?
Well, ugly for ugly, perhaps could you try this one:
tell application "Safari" to activate
tell application "System Events"
tell application process "Safari"
keystroke "P" using command down
set {X, Y} to position of sheet 1 of front window
set {X, Y} to {X + 202 + 19, Y + 165 + 19}
click at {X, Y}
keystroke return
end tell
end tell
In my case (10.4.11/3.1.2/French), the "Landscape" button appears at
offset {202, 165} in the dialog, and its size is {38, 38}, hence the
above integer values.
HTH,
Axel
_______________________________________________
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