Re: weird UI scripting problems-- solved
Re: weird UI scripting problems-- solved
- Subject: Re: weird UI scripting problems-- solved
- From: Deivy Petrescu <email@hidden>
- Date: Tue, 11 Nov 2003 16:55:59 -0500
On Nov 11, 2003, at 6:56 AM, Bill Cheeseman wrote:
Why are you bringing the System Events application to the front before
scripting the "Windows Media Player" process? In some situations, I
believe,
GUI Scripting will only work when the targeted process is frontmost.
Bill, I am starting to script UI more often. So I am still in my
debugging phase, that is, some of the code is for cut and paste. so the
frontmost is there to let me use any application I want in front.
Actually according to my tests
___
tell application "Script Editor" to activate
tell application "System Events"
set frontmost to true
-----
keeps Script Editor as the frontmost application, but it is easy to
just stick another name if I want to run tests.
I've learned something. One targets the front application when one
sends the keystroke command. For instance
tell application "Script Editor" to activate
tell application "System Events"
set frontmost to true
tell process "TextEdit"
keystroke "a"
end tell
end tell
it types an "a" on Script Editor, to my surprise!
However, my experiments reveal that GUI Scripting simply doesn't work
on the
new Windows Media Player 9, anyway. 'get attributes of window 1', for
example, under Panther. I'm puzzled by this, since UI Browser easily
and
correctly reads its elements and attributes using the Accessibility
API, on
which GUI Scripting is based.
Same here!
The intriguing stuff is that in my desktop, I get nothing returned from
*any* application.
Which is very intriguing!!
Also, keystroke "number" does not work no matter how i disguise the
number.
As kai suggested keystroke (ASCII character 51)
This is what I got:
repeat with k from 40 to 66
keystroke (ASCII character k)
end repeat
end tell
---->()*+,-/:;<=>?@AB
No numbers!
kai and Mark reported that they are fine with iBooks. Mine is 800 just
like Mark's.
I do not understand .
You and Rob report you are alright with PowerBook's and my desktop is
fine with numbers but screwed up with other properties.
since the versions are the same, is there anything that could be
corrupting my settings. I have very few extras. Mostly applications
which should not play with the OS.
Solution to my problems:
Actually, thanks Bill you've pointed out UI Element Inspector, and
when i tried it in my desktop which had nothing returning from SE
scripting, it complained that I did not have "enable for assistive
device" checked. It was originally checked and probably changed on the
upgrade. However, it did allow me to script SE and even use keystroke
"4". So I thought I had it on.
Also, I've found out why my iBook was not typing numbers, because mouse
keys on the mouse panel of the Universal Access pane was on.
So now everything is working fine.
Thanks to all.
Deivy
_______________________________________________
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.