ich habe mal für das Clicken eine rudimentäre Funktion zusammengefasst.
Da auch das Klicken in der UI nur ein simulierter Mausklick ist, sehe ich da auch für deinen Fall die Möglichkeit das mit allen Möglichkeiten zu vermischen. Da du auch nur der Einzige bist, der das Script verwendet, sollte das umsetzbar sein.
Im Anhang mein umgebautes Script, dass dir zumindest die Sprache auf deutsch umstellt.
Vielleicht kannst du dich daran entlang hangeln.
AutoIt
#include "UIA_Functions.au3"
_UI_ClickItem("ROPEXvisual", "TabItem", "Settings")
_UI_ClickItem("ROPEXvisual", "ButtonItem", "Language")
_UI_ClickItem("ROPEXvisual", "ButtonItem", "Öffnen")
Send("{UP}")
Send("{ENTER 2}")
Func _UI_ClickItem($s_UI_Windowtitle, $s_UI_ControlType, $UI_Text)
;If Not IsObj($oUIAutomation) Then Return SetError (1,1,0)
Local $Opt_WinTitle = Opt("WinTitleMatchMode", 2)
Local $pUI_Object, $o_UI_Window, $UIA_TypeID, $pCondition, $pCondition1, $pCondition2, $pAndCondition, $pValue, $pDesktop, $pPointer1, $pPointer2
Local $sUI_WinTitle = WinGetTitle($s_UI_Windowtitle, '')
; Find Desktop
$oUIAutomation = ObjCreateInterface($sCLSID_CUIAutomation, $sIID_IUIAutomation, $dtagIUIAutomation)
$oUIAutomation.GetRootElement($pDesktop)
$oDesktop = ObjCreateInterface($pDesktop, $sIID_IUIAutomationElement, $dtagIUIAutomationElement)
If Not IsObj($oDesktop) Then Return SetError (1,1,0)
; Find Main Window
$oUIAutomation.CreatePropertyCondition( $UIA_NamePropertyId, $sUI_WinTitle, $pCondition )
$oDesktop.FindFirst($TreeScope_Descendants, $pCondition, $pPointer1)
$oWin_Main = ObjCreateInterface($pPointer1, $sIID_IUIAutomationElement, $dtagIUIAutomationElement)
If Not IsObj($oDesktop) Then Return SetError (1,1,0)
Switch $s_UI_ControlType
Case "TabItem"
$UIA_TypeID = $UIA_TabItemControlTypeId
Case "ButtonItem"
$UIA_TypeID = $UIA_ButtonControlTypeId
EndSwitch
$oUIAutomation.CreatePropertyCondition($UIA_ControlTypePropertyId, $UIA_TypeID, $pCondition1)
$oUIAutomation.CreatePropertyCondition($UIA_NamePropertyId, $UI_Text, $pCondition2)
$oUIAutomation.CreateAndCondition($pCondition1, $pCondition2, $pAndCondition)
$oWin_Main.FindFirst($TreeScope_Descendants, $pAndCondition, $pPointer2)
$oUI_ClickItem = ObjCreateInterface($pPointer2, $sIID_IUIAutomationElement, $dtagIUIAutomationElement)
If Not IsObj($oUI_ClickItem) Then Return SetError (1,2,0)
$oUI_ClickItem.GetCurrentPattern($UIA_ValuePatternId, $pValue)
WinActivate($o_UI_Window)
UIA_MouseClick($oUI_ClickItem)
Opt("WinTitleMatchMode", $Opt_WinTitle)
Return SetError(0,0,1)
EndFunc
Alles anzeigen