Re: UI Scripting, Safari and text field
Re: UI Scripting, Safari and text field
- Subject: Re: UI Scripting, Safari and text field
- From: Ronald Cross <email@hidden>
- Date: Fri, 9 Jan 2004 00:56:49 -0700
I would like to get in on the conversation. I have been trying to do
the same thing for the last month and a half. I use a command that is
similar to the one described below, but nothing is entered in the text
field in the browser. I even tried forcing a text into the field by
clicking at the text field by it {x,y} location. I get nothing. I
currently have a patch that does allow me to enter text in the text
field browser. I do this by writing a script that moves and click the
mouse over the text field in the browser and then I paste the text into
the field using applescript commands. This does work, but there is
considerable delay in using this method. I know that if there was a
way to enter text without system events, entering text in a browser
would be much faster.
There are several options that I haven't had the opportunity to try
yet. One, you can try another browser, such as Mozilla. Two, you can
try to write a javascript that will capture the text. I haven't had
time to use any of these options yet since I need to move onto other
projects. Let's work on this together to see what we can come up with.
thx
RLC
On Thursday, Jan 8, 2004, at 13:30 America/Phoenix, Bill Cheeseman
wrote:
on 2004-01-08 2:21 PM, Timothy K. Wilkinson at email@hidden
wrote:
I'm trying to use the UI Scripting to set a text field of a web page
to a
certain value.
Using PreFab's UI Browser I came up with this script:
tell application "System Events"
tell process "Safari"
set value of text field 1 of scroll area 1 of group 2 of window
"Add
new user" to "some text"
end tell
end tell
This works on the surface. It puts the text into the field on the
web page
and everything seems fine. However when you click on the field the
text
disappears. If you don't select the field but just click the submit
button
then a blank value is submitted.
What step am I missing to make that value stick in the web page?
Just a guess, but I suspect that Safari's support for the
Accessibility API
somehow fails to pass the text it sees in the text field on to the HTML
form. I don't know enough about how Safari or other Web browsers handle
forms in their main windows to be sure how that would work. Is it
possible
that there may be some spoofing going on? -- where the text field you
see
and the text field Safari sees are actually separate user controls
superimposed on one another?
What happens if you use GUI Scripting to force the "focus" to another
text
field in the form, after filling in the first text field but before
clicking
the Submit button?
--
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
_______________________________________________
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.
thanks
Ronald Cross
_______________________________________________
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.