Jump to content

Recommended Posts

Posted

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~ ;)

Posted

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

 

Posted
  On 1/8/2018 at 2:34 PM, 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

 

Expand  

I think this is what im looking for :D 

Hope autoit doesn't mind 3 levels of while 1 loops.

;) ~XN~ ;)

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
  • Recently Browsing   0 members

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