Page 1 of 1

UIAUTOMATION, how to click a Edit type

Posted: 19 Apr 2024, 00:06
by shawn_xwang

Code: Select all

^s:: ;search
UIA := UIA_Interface() ; Initialize UIA interface
;~ WinActivate, ahk_exe PBIDesktop.exe ;ahk_exe notepad.exe
npEl := UIA.ElementFromHandle("ahk_exe PBIDesktop.exe") ; Get the element for the Notepad window
fileEl := npEl.FindFirstByNameAndType("Search", "Edit") ; Find the "File" menu item
fileEl.Highlight()
fileEl.Click()
;~ fileE1.GetClickablePoint().click
;~ fileEl.SetFocus()
;~ msgbox, %fileE1%
;~ fileE1.Value := %Clipboard%
;~ fileEl.Highlight()

return
Hello all
in this lines of code, the clik won't work, but highlight is there, I am not sure where is wrong, is Edit type not clicable or not
in power BI desktop application, the search bar with name of search and type as Edit
image.png
(19.29 KiB) Downloaded 35 times
image.png
(22.16 KiB) Downloaded 35 times