ssah8 Posted November 5, 2016 Posted November 5, 2016 I can't figure this out. If I have a browser open, and I make the browser click on a button that opens up a new browser window. How can I make the following code to apply to the second window that popped up? My code is still applying to the previous window (which I don't want to close) Case $start _IENavigate($oIE, "http://google.com") sleep(5000) For $i = 1 To $repeat1 Local $oInputs = _IETagNameGetCollection($oIE, "button") For $oInput In $oInputs If $oInput.classname == "button blue" Then _IEAction($oInput, "click") Next Sleep(3000) WinActivate("YouTube - Internet Explorer") Local $oInputs = _IETagNameGetCollection($oIE, "button") For $oInput In $oInputs If $oInput.classname == "yt-uix-button yt-uix-button-size-default yt-uix-button-opacity yt-uix-button-has-icon no-icon-markup like-button-renderer-like-button like-button-renderer-like-button-clicked yt-uix-button-toggled yt-uix-post-anchor yt-uix-tooltip" Then _IEAction($oInput, "click") Next Next I changed some links, but the main thing here is how to apply the next code to the new window (YouTube)
j0kky Posted November 5, 2016 Posted November 5, 2016 (edited) You should retrieve href url and create new windows through _IECreate() instead of clicking on buttons. If you want to follow your way, you can get new window object through _IEAttach() Edited November 5, 2016 by j0kky Spoiler Some UDFs I created: Winsock UDF STUN UDF WinApi_GetAdaptersAddresses _WinApi_GetLogicalProcessorInformation Bitwise with 64 bit integers An useful collection of zipping file UDFs
ssah8 Posted November 5, 2016 Author Posted November 5, 2016 Im quiet new to AutoIT, I think I get what you are saying. Would you mind giving me a small example? I would really appriciate it.
j0kky Posted November 5, 2016 Posted November 5, 2016 I just read your started-topic history, and I think you are trying to violate forum rules; so sorry, I can't help you. Spoiler Some UDFs I created: Winsock UDF STUN UDF WinApi_GetAdaptersAddresses _WinApi_GetLogicalProcessorInformation Bitwise with 64 bit integers An useful collection of zipping file UDFs
ssah8 Posted November 5, 2016 Author Posted November 5, 2016 Im not. I quitted that project. Now Im just trying to learn AutoIT.
Developers Jos Posted November 5, 2016 Developers Posted November 5, 2016 (edited) seriously ... just learning? Not convinced ... and better not try this again.Maybe they have better support, but seems your are burning credit there as well. *click* Jos Edited November 5, 2016 by Jos AutoBert 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Recommended Posts