• 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, Safari and text field
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UI Scripting, Safari and text field


  • Subject: Re: UI Scripting, Safari and text field
  • From: Bill Cheeseman <email@hidden>
  • Date: Thu, 08 Jan 2004 15:30:55 -0500

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.

  • Follow-Ups:
    • Re: UI Scripting, Safari and text field
      • From: Ronald Cross <email@hidden>
References: 
 >UI Scripting, Safari and text field (From: "Timothy K. Wilkinson" <email@hidden>)

  • Prev by Date: UI Scripting, Safari and text field
  • Next by Date: Re: AB: launch app in background?
  • Previous by thread: UI Scripting, Safari and text field
  • Next by thread: Re: UI Scripting, Safari and text field
  • Index(es):
    • Date
    • Thread