Jump to content

Recommended Posts

Posted

You will want to look at the family of _IE functions in your help file when dealing with browsers.

  Reveal hidden contents

 

Posted (edited)

Well, the workaround is to grab the URL control...but you won't be able to do anything once you navigate, since you can't interact with the dom object:

ControlSetText("[CLASS:Chrome_OmniboxView]", "", "[CLASS:Chrome_OmniboxView; INSTANCE:1]", "https://www.youtube.com")
Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Posted

  On 4/22/2013 at 7:47 PM, 'jdelaney said:

Well, the workaround is to grab the URL control...but you won't be able to do anything once you navigate, since you can't interact with the dom object:

ControlSetText("[CLASS:Chrome_OmniboxView]", "", "[CLASS:Chrome_OmniboxView; INSTANCE:1]", "https://www.youtube.com")

This didn't do anything. I guess the only way is to click on the omnibox and then ctrl + v
Posted (edited)

That's really weird, I can only manipulate the URL when using the HWND for the window and control...

$hwnd = WinGetHandle("[CLASS:Chrome_WidgetWin_1]")
If Not IsHWnd($hwnd) Then
 MsgBox(1,1,1)
 Exit
EndIf
WinActivate($hwnd)
$hControl = ControlGetHandle($hwnd, "", "[CLASS:Chrome_OmniboxView; INSTANCE:1]")
If Not IsHWnd($hControl) Then
 MsgBox(1,1,2)
 Exit
EndIf
ControlFocus($hwnd, "", $hControl)
ControlSend($hwnd, "", $hControl, "")
ControlSetText($hwnd, "", $hControl, "https://www.test2.com")
Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Posted (edited)

Tested and it works for me... but I specified a text for my Window Title. However, you'll have to CTRL+A and {DEL} first as it doesn't highlight text when you controlsend.

Func _ChromeSendURL()
    Opt("WinTitleMatchMode", 2) ; Perform a string-in-string type search for window titles.
    ControlSend("AutoIt Forums", "", "[CLASS:Chrome_OmniboxView; INSTANCE:1]", "TESTING")
EndFunc
Edited by Mechaflash
  Reveal hidden contents

 

Posted

  On 4/22/2013 at 7:59 PM, 'MouseSpotter said:

Try this:

1. Go to google home page

2. ControlSend("Google","","[CLASS:Chrome_OmniboxView; INSTANCE:1]","{home}+{end}test")

Shouldn't that be {home} {shift}+{end}?

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Posted

  On 4/22/2013 at 8:02 PM, 'Blue_Drache said:

Shouldn't that be {home} {shift}+{end}?

'+'

This tells AutoIt to send a SHIFT keystroke, therefore Send("Hell+o") would send the text "HellO". Send("!+a") would send "ALT+SHIFT+a".

Posted

here we go :)

Func _ChromeSendURL()
    ControlSetText("[CLASS:Chrome_WidgetWin_1]", "", "[CLASS:Chrome_OmniboxView; INSTANCE:1]", "TESTING")
EndFunc
  Reveal hidden contents

 

  • 2 months later...
Posted (edited)

  On 4/22/2013 at 8:11 PM, Mechaflash said:

here we go :)

 

Func _ChromeSendURL()
    ControlSetText("[CLASS:Chrome_WidgetWin_1]", "", "[CLASS:Chrome_OmniboxView; INSTANCE:1]", "TESTING")
EndFunc
_ChromeSendURL()
Func _ChromeSendURL()
    ControlSetText("[CLASS:Chrome_WidgetWin_1]", "", "[CLASS:Chrome_OmniboxView; INSTANCE:1]", "TESTING")
EndFunc
 
This doesn't do anything. Help please.
Edited by SergeySpandaryan
Posted

Read this carefully - You either need to use IE.au3 which means you use IE ...or use FF.au3 which uses Firefox. Using controlsend in a web based window DOES NOT WORK. I do not care you use chrome. Chrome for the most part resist automation for that is how the security for chrome is setup.

NO - you can't get around this. Others have tried and failed. These are your choices in automating this. If you do not like your choices then you are out of luck.

Posted
  On 7/22/2013 at 1:02 PM, YogiBear said:

Read this carefully - You either need to use IE.au3 which means you use IE ...or use FF.au3 which uses Firefox. Using controlsend in a web based window DOES NOT WORK. I do not care you use chrome. Chrome for the most part resist automation for that is how the security for chrome is setup.

NO - you can't get around this. Others have tried and failed. These are your choices in automating this. If you do not like your choices then you are out of luck.

Do you mean Chrome's address bar is web based?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...