XaelloNegative Posted January 8, 2018 Posted January 8, 2018 Hi im quite new to _IE automation although i've already made a couple of GUIs and automation processes using autoit. Just wanted to know if there is a more efficient way of closing an IE browser with multiple tabs. I currently use the array method which i find somehow inefficient but gets the job done. Any ideas will be appreciated. Thank you. ~XN~ ~XN~
Danp2 Posted January 8, 2018 Posted January 8, 2018 You could use _IEQuit in a loop, like this -- #include <IE.au3> Const $navOpenInNewTab = 0x0800 Local $oIE = _IECreate('http://www.google.com/') $oIE.Navigate2('http://www.yahoo.com/', $navOpenInNewTab) $oIE.Navigate2('http://autoitforum.com/', $navOpenInNewTab) While 1 $oIE = _IEAttach ("", "instance", 1) If @error = $_IEStatus_NoMatch Then ExitLoop _IEQuit($oIE) WEnd XaelloNegative 1 Latest Webdriver UDF Release Webdriver Wiki FAQs
XaelloNegative Posted January 8, 2018 Author Posted January 8, 2018 1 hour ago, Danp2 said: You could use _IEQuit in a loop, like this -- #include <IE.au3> Const $navOpenInNewTab = 0x0800 Local $oIE = _IECreate('http://www.google.com/') $oIE.Navigate2('http://www.yahoo.com/', $navOpenInNewTab) $oIE.Navigate2('http://autoitforum.com/', $navOpenInNewTab) While 1 $oIE = _IEAttach ("", "instance", 1) If @error = $_IEStatus_NoMatch Then ExitLoop _IEQuit($oIE) WEnd I think this is what im looking for Hope autoit doesn't mind 3 levels of while 1 loops. ~XN~
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