Sign in to follow this  
Followers 0
caramen

Text searching

9 posts in this topic

#1 ·  Posted (edited)

Hello all :)

I got that autoit windows info showing to myself these results :

BLABLA 1

BLABLA 2

I need to search for the visible text ligne : 3515

"10.19.21.0 VLAN 3515"

"10.19.21.1 VLAN 3516"

"10.19.21.2 VLAN 3517"

"10.19.21.3 VLAN 3518"

(And i see it in windows info visible text section)

and click on it...

it s in a combot box

what is the best thing for that ?

Mousclick to deploy combot box items,

then .... ?

I need somthing like pixel search but for text

 

i find the command

WinGetText after find the text how to click on it?

 

i guess somthing about :

The visible text =

"10.19.21.0 VLAN 3515"

"10.19.21.1 VLAN 3516"

"10.19.21.2 VLAN 3517"

"10.19.21.3 VLAN 3518"

 

$Vlan = 3515

$A = Wingettext = $Vlan

$B= wingetpos = $A

Mouseclick = $B

Edited by caramen

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I did That :

Global $VlanLabel = GUICtrlCreateLabel ("Entrer votre Vlan :", 180, 210, 150, 50)
    Global $VlanA = GUICtrlCreateInput ("Vlan?", 180, 230, 150, 20)

                     While (1)
                        $VlanB = GUICtrlRead($VlanA)
                        If $VlanB = "Vlan?" then
                        MsgBox($MB_SYSTEMMODAL, "Merci", "Selectionnez le VLAN manuellement. Puis valider.") ;Select the Vlan Manualy
                           ExitLoop
                        Else
                          $Pos = WinGetText  ($VlanB)
                          $Position = WinGetPos ($Pos)
                          MouseClick ("Left" , $Position[0]-1,$Position[0]-1)
                     WEnd

It clicking to pixel 0,0

Is it even possible to a get the posision of a result from WinGetText ??? :

 

Not working, anyhelp ?

Edited by caramen

Share this post


Link to post
Share on other sites

up

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

It s a windows Combot box item from the software Virtual Center VMware Vsphere

In the autoit software "Windows info" The text apear corectly so i expect it is readable easy but

my question: when i read a text with autoit and when i found it: how to click on it ... Just a simple left click

Edited by caramen

Share this post


Link to post
Share on other sites

No point in automating vsphere, when they have an api you can call directly.

https://www.vmware.com/support/developer/windowstoolkit/wintk40u1/html/


IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites

ControlGetHandle  -- >  ControlGetText  -->  ControlGetPos and ControlClick

 

Can you provide me plz an exemple of ControlGetHandle usage plz ? (to understand that easy)

Share this post


Link to post
Share on other sites

Can you provide me plz an exemple of ControlGetHandle usage plz ? (to understand that easy)

 

fresh from the helpfile :

#include <MsgBoxConstants.au3>

Example()

Func Example()
    ; Run Notepad
    Run("notepad.exe")

    ; Wait 10 seconds for the Notepad window to appear.
    Local $hWnd = WinWait("[CLASS:Notepad]", "", 10)

    ; Retrieve the handle of the edit control in Notepad. The handle returned by WinWait is used for the "title" parameter of ControlGetHandle.
    Local $hControl = ControlGetHandle($hWnd, "", "Edit1")

    ; Display the handle of the edit control.
    MsgBox($MB_SYSTEMMODAL, "", "The handle of Edit1 is: " & $hControl)

    ; Close the Notepad window using the handle returned by WinWait.
    WinClose($hWnd)
EndFunc   ;==>Example

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

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