04-21-2016, 04:10 PM
Chrome does not support setting control text in this way. From web browsers, only Internet Explorer supports.
Need to select/focus the control and send keys with key() or paste with paste().
Normally this code could be used, but the Google search field does not respond to Select.
Macro Macro2778
Even Tab key does not select that field.
Then try to enter text in the address bar.
Macro Macro2779
or
Macro Macro2780
Need to select/focus the control and send keys with key() or paste with paste().
Normally this code could be used, but the Google search field does not respond to Select.
Macro Macro2778
int w=wait(3 WV win("New Tab - Google Chrome" "Chrome_WidgetWin_1"))
act w
Acc a.Find(w "STATICTEXT" "Search Google or type URL" "" 0x3001 3)
a.Select(1)
str s="Some value"
key (s)
;or
;paste s
Even Tab key does not select that field.
Then try to enter text in the address bar.
Macro Macro2779
int w=win("New Tab - Google Chrome" "Chrome_WidgetWin_1")
act w
Acc a.Find(w "TEXT" "Address and search bar" "class=Chrome_WidgetWin_1[]state=0x100000 0x20000040" 0x1005)
a.SetValue("Some value") ;;works but does not start searching; then I tried DoDefaultAction and Enter, and it worked; also tried Select, but Chrome says 'not implemented'
a.DoDefaultAction
key Y
or
Macro Macro2780