Sign in to follow this  
Followers 0
gamarga

Middle Mouse Click _IEAction

5 posts in this topic

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

 

 

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

You could use __IENavigate (note the double underscore) instead of _IEAction to launch a new tab for the desired URL.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Thanks for your help guys!

Share this post


Link to post
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
Sign in to follow this  
Followers 0

  • Similar Content

    • Gordi300
      By Gordi300
      Hey everyone!! 
      I'm trying to make a program in VB.NET that click inside a picturebox of an app without moving the mouse (using ControlClick).
      My code is this:
      1) ControlClick("Form1", "", "[CLASS:PictureBox; INSTANCE:12]", "left", 1, 5, 5) 2) ControlClick("Form1", "", "[CLASS:PictureBox; INSTANCE:1]", "left", 1, 5, 5) The code is correct  but the problem is that 1) works perfectly and 2) doesn't work. 
      '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
      Here I leave you the summary of each picturebox:
      >>>> Window <<<<
      Title:    Form1
      Class:    Form
      Position:    168, 0
      Size:    1030, 780
      Style:    0x16CA0000
      ExStyle:    0x00040100
      Handle:    0x00000000000B0092
       
      >>>> Control <<<<                PICTUREBOX 12
      Class:    PictureBox
      Instance:    12
      ClassnameNN:    PictureBox12
      Name:    
      Advanced (Class):    [CLASS:PictureBox; INSTANCE:12]
      ID:    28
      Text:    
      Position:    305, 721
      Size:    40, 40
      Style:    0x56010000
      ExStyle:    0x00000004
      Handle:    0x0000000000040520
       
      >>>> Control <<<<                PICTUREBOX 1
      Class:    PictureBox
      Instance:    1
      ClassnameNN:    PictureBox1
      Name:    
      Advanced (Class):    [CLASS:PictureBox; INSTANCE:1]
      ID:    4
      Text:    
      Position:    4, 176
      Size:    700, 533
      Style:    0x56010000
      ExStyle:    0x00000004
      Handle:    0x00000000000E02BE
       
      Thank you for you help!!!
    • Caladan
      By Caladan
      Hi guys!
      I'm working in a Android app, and emulating in Nox. I make a little script to send mouse clicks in location settings, to constantly change my GPS position. And it's working with MouseClick. But...
      My ControlClick does not work! And I need my cursor free! 
      ControlClick("[TITLE:Nox; CLASS:Qt5QWindow]","","", "left",3,1247,384) ;~ <- This is NOT working ;~ MouseClick("left",1247,384,3) ;~ <- This is working Sleep(300) ClipPut($eLat) There is no >>>Control<<< info. There is no ID. Just mouse coords. What I need to do guys?

    • Dequality
      By Dequality
      I'm currently wondering if there is somehow to actually make autoit click inside a minimized program? & sent keystrokes ? 
      2nd question, how can i make it do a mouse click at e.g. x200,y200 while the are at like x354,y313 (This is purely an example.) would love to be able to do other shizz on my pc while the script is running if possible.
      If this ISNT possible can u recommend a language / other scripting program which are able to do this ? willing to start over learning a new coding/scripting language.
       
      -Dequality.
    • theak
      By theak
      I have an install that I'm trying to deploy on both 32 bit and 64 bit machines. Trying to move more to 64 bit but still curious about making this work for both at the same time.
      This is the 32 bit version of the script. I tried to make this same script work for a 64 bit install but realized the button IDs were different. Same install exe though.
      What's the smart way to detect the buttonIDs based on the OS architecture? I thought possibly having the button ID as a variable with case selects but I wasn't quite sure how to pull it off.
       
      #Region #AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator #EndRegion #include <FileConstants.au3> #include <MsgBoxConstants.au3> Run("\\servername\cofs\Organization\ITS\_Software & Hardware\AS400\DVD\Windows\cwblaunch.exe") ;WinWaitActive("Security Warning","",5) ;ControlClick("Open File - Security Warning","&Run",4426,"left",1) WinWaitActive("Choose Setup Language","",5) sleep(500) ControlClick("Choose Setup Language","OK",1006,"left",1) Do Sleep(10) Until ControlCommand("IBM i Access for Windows 7.1 - InstallShield Wizard","&Next >","Button1","IsEnabled") sleep(500) ;MsgBox($MB_OK,"Control Command Found","Sent for first wait hang") ControlClick("IBM i Access for Windows 7.1 - InstallShield Wizard","&Next >",23467,"left",1) sleep(500) ControlClick("IBM i Access for Windows 7.1 - InstallShield Wizard","I &accept the terms in the license agreement",22951,"left",1) sleep(500) ControlClick("IBM i Access for Windows 7.1 - InstallShield Wizard","&Next >",23467,"left",1) sleep(500) ControlClick("IBM i Access for Windows 7.1 - InstallShield Wizard","&Next >",23467,"left",1) sleep(500) ControlClick("IBM i Access for Windows 7.1 - InstallShield Wizard","&Next >",23467,"left",1) sleep(500) ControlClick("IBM i Access for Windows 7.1 - InstallShield Wizard","&Next >",23467,"left",1) sleep(500) ControlClick("IBM i Access for Windows 7.1 - InstallShield Wizard","&Install",23546,"left",1) ;Wait for finish button to appear Do $Finish = ControlGetHandle("IBM i Access for Windows 7.1 - InstallShield Wizard", "Finish", 23500) Sleep(100) Until $Finish <> "" sleep(500) ControlClick("IBM i Access for Windows 7.1 - InstallShield Wizard", "Finish", 23500,"left",1) ;Start second part of install Run("\\servername2\Apps$\AutoIT\AS400\AS400_2 Patch_1.exe"  
    • Ikedor
      By Ikedor
      I’m trying to click the “assign a playlist” url in this application (see info.png)
      I don’t know if it is flash or not.
       
      The control ID changes on every launch.
      I can’t use mouseclick because it needs to be scheduled at night on a server.
      So just ControlClick is left as an option.
      I can find the handle to the window but not to the control, be it through text or classname, clas or advanced mode.
      The mouse cursor doesn't even move after these commands. 
       
      $handle = WinGetHandle("[ACTIVE]")
      ControlClick($handle, "", "[CLASS:TFlickerFreePaintBox.UnicodeClass; INSTANCE:1]",'left', 1, 54, 138)
      ControlFocus("Q-MATIC Monitor™ 3", "", "[TFlickerFreePaintBox.UnicodeClass1]")
      Controlclick("Q-MATIC Monitor™ 3", "",", "primary", 1, 54, 55)
      ControlClick($handle, "", "", "Left", 1, 54, 55)
      ControlClick("Q-MATIC Monitor™ 3", "", "[TEXT:Assign to playlist]")
      ControlFocus ( "Q-MATIC Monitor™ 3", "", "TFlickerFreePaintBox.UnicodeClass")
       
      What other parameters are possible for this?