Jump to content

controlsend doesn't work


Recommended Posts

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

Spoiler

“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”

 

Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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
Spoiler

“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”

 

Link to comment
Share on other sites

here we go :)

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

“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”

 

Link to comment
Share on other sites

  • 2 months later...

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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