SergeySpandaryan Posted April 22, 2013 Share Posted April 22, 2013 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. Link to comment Share on other sites More sharing options...
Mechaflash Posted April 22, 2013 Share Posted April 22, 2013 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 More sharing options...
SergeySpandaryan Posted April 22, 2013 Author Share Posted April 22, 2013 You will want to look at the family of _IE functions in your help file when dealing with browsers.I don't use IE. Link to comment Share on other sites More sharing options...
jdelaney Posted April 22, 2013 Share Posted April 22, 2013 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. Link to comment Share on other sites More sharing options...
SergeySpandaryan Posted April 22, 2013 Author Share Posted April 22, 2013 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? Link to comment Share on other sites More sharing options...
jdelaney Posted April 22, 2013 Share Posted April 22, 2013 (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 April 22, 2013 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 More sharing options...
SergeySpandaryan Posted April 22, 2013 Author Share Posted April 22, 2013 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 More sharing options...
jdelaney Posted April 22, 2013 Share Posted April 22, 2013 (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 April 22, 2013 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 More sharing options...
Mechaflash Posted April 22, 2013 Share Posted April 22, 2013 (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 April 22, 2013 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 More sharing options...
MouseSpotter Posted April 22, 2013 Share Posted April 22, 2013 Try this: 1. Go to google home page 2. ControlSend("Google","","[CLASS:Chrome_OmniboxView; INSTANCE:1]","{home}+{end}test") Link to comment Share on other sites More sharing options...
Blue_Drache Posted April 22, 2013 Share Posted April 22, 2013 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 Link to comment Share on other sites More sharing options...
jdelaney Posted April 22, 2013 Share Posted April 22, 2013 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. Link to comment Share on other sites More sharing options...
MouseSpotter Posted April 22, 2013 Share Posted April 22, 2013 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". Link to comment Share on other sites More sharing options...
Mechaflash Posted April 22, 2013 Share Posted April 22, 2013 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 More sharing options...
SergeySpandaryan Posted July 21, 2013 Author Share Posted July 21, 2013 (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 July 21, 2013 by SergeySpandaryan Link to comment Share on other sites More sharing options...
SergeySpandaryan Posted July 22, 2013 Author Share Posted July 22, 2013 bump Link to comment Share on other sites More sharing options...
Bert Posted July 22, 2013 Share Posted July 22, 2013 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. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
SergeySpandaryan Posted July 27, 2013 Author Share Posted July 27, 2013 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 More sharing options...
Bert Posted July 27, 2013 Share Posted July 27, 2013 Do you mean Chrome's address bar is web based?NO. YOU CAN NOT USE CHROME TO DO WHAT YOU ARE ASKING FOR. Stop trying to get a way to interact with Chrome. Use IE or Firefox if you want to use AutoIt. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
junkew Posted July 28, 2013 Share Posted July 28, 2013 Chrome can easy be automated with ui automation. Search in the forum for ui automation. FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now