Jump to content

Middle Mouse Click _IEAction


Go to solution Solved by T0M50N,

Recommended Posts

Hi,

I am using code below to find a link in IE. I need to open the link in another tab. Is there a way or function to middle mouse button click with _IEAction?

 
Local $sMyString = "DLM-"
Local $oLinks = _IELinkGetCollection($LAMA)
For $oLink In $oLinks
    Local $sLinkText = _IEPropertyGet($oLink, "innerText")
    If StringInStr($sLinkText, $sMyString) Then
  MsgBox(0, "Form Info", "found your link")
        _IEAction($oLink, "click")
        ExitLoop
    EndIf
 Next

 

 

Link to comment
Share on other sites

I tried this and it works however I would prefer a cleaner way than using the "Send" fucntion....

Any ideas?

Local $sMyString = "DLM-"
Local $oLinks = _IELinkGetCollection($LAMA)
For $oLink In $oLinks
    Local $sLinkText = _IEPropertyGet($oLink, "innerText")
    If StringInStr($sLinkText, $sMyString) Then
       MsgBox(0, "Form Info", "found your link")
         Send("{CTRLDOWN}")
        _IEAction($oLink, "click")
        Send("{CTRLUP}")
        ExitLoop
    EndIf
 Next

Cheers

Link to comment
Share on other sites

  • Solution

Why do you need to click the link?

With help from this post 

#include <IE.au3>
Const $navOpenInNewTab = 0x0800

Local $oIE = _IECreate("http://www.autoitscript.com/site/")
Local $oLinks = _IELinkGetCollection($oIE)
For $oLink In $oLinks
    If StringInStr($oLink.href, "/forum/") Then
        $oIE.Navigate2($oLink.href, $navOpenInNewTab)
        ExitLoop
    EndIf
Next
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

×
×
  • Create New...