Sign in to follow this  
Followers 0
SergeySpandaryan

controlsend doesn't work

41 posts in this topic

ControlSend("[CLASS:Chrome_OmniboxView]", "", "", "https://www.youtube.com")

Why doesn't this work? I want https://www.youtube.com to be put in my browser.

Share this post


Link to post
Share on other sites



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.”

 

Share this post


Link to post
Share on other sites

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

I don't use IE.

Share this post


Link to post
Share on other sites

Last I checked, there is no chrome UDF. You'll need to use IE or Firefox (ff.au3)


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.

Share this post


Link to post
Share on other sites

Last I checked, there is no chrome UDF. You'll need to use IE or Firefox (ff.au3)

Thank you very much. Can you tell why is my script not working?

Share this post


Link to post
Share on other sites

#6 ·  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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

#8 ·  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.

Share this post


Link to post
Share on other sites

#9 ·  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

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.”

 

Share this post


Link to post
Share on other sites

Try this:

1. Go to google home page

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Controlsettext clears out, and changes text...controlsend only pre-appends


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.

Share this post


Link to post
Share on other sites

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".

Share this post


Link to post
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.”

 

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

bump

Share this post


Link to post
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.

Share this post


Link to post
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?

Share this post


Link to post
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
Sign in to follow this  
Followers 0