Jump to content

Close IE current Tab without "^w"


larryvns
 Share

Recommended Posts

Starting with open a HOME webpage, then click a link jump to new TAB (new page) Now after registered, I need to close this new TAB so i can automatically be back to HOME page. Inorder to run this script in minimize mode, I can't used SEND and CONTROLSEND can;t used either (since it outside $handle).  Any other solution can be done?  Thank you for your help.

Please note: I do know hotkey "^w" is closing current tab, but it not working in my case, since i wanted to run this script in minimize mode or in background.

Link to comment
Share on other sites

Have you looked at the _IEQuit function in the help file?

Danp2, Thank you to look at my problem.

Yes, I already look at _IEQuit, but this function need Title ($oIE ....etc)  And what i am talking about is... right now i am at the 2th Tab and with different Title...... I guessed! 

Link to comment
Share on other sites

with this thread you can do it with code as provided (however also minimized will not work and I doubt if it can work that way as elements are not available once minimized)

suggestion however could be to move the IE window to the right bottom last pixel so out of sight then it will work

'?do=embed' frameborder='0' data-embedContent>>

could be you have to change $UIA_oDesktop to $oDesktop (next version of UIA wrappers I will have $UIA_ as prefix)
 

#include "UIAWrappers.au3"

;~ _UIA_setVar("global.debug.file",false)

const $cBrowser="classname:=IEFrame"
const $cTabBar="classname:=ReBarWindow32"
const $closeText=".*((sluiten)|(close))" ;Handle dutch and english text

$oIE=_UIA_getFirstObjectOfElement($UIA_oDesktop, $cBrowser, $treescope_children)
$oIETabBar=_UIA_getFirstObjectOfElement($oIE, $cTabBar, $treescope_children)

$oCloseTab=_UIA_getObjectByFindAll($oIETabbar, $closeText , $treescope_subtree) 
_UIA_Action($oCloseTab,"invoke") ;click will only work when you set focus first
Link to comment
Share on other sites

Danp2, Thank you to look at my problem.

Yes, I already look at _IEQuit, but this function need Title ($oIE ....etc)  And what i am talking about is... right now i am at the 2th Tab and with different Title...... I guessed! 

 

_IEQuit will do what you need.  If you really _do_ read about it, you will see that it does not require a title but rather an object.  Hint: read about _IEAttach as well.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
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
 Share

  • Recently Browsing   0 members

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