我需要找到链接其工具提示的控件名称。我之所以要这是因为我需要在TeamCenter 10中控制单击,但是在您单击任何一个时,控制名称在不断变化。这使得在需要重复任务时保持代码顺利运行起来很难。
如果有更好的方法(在Autohotkey中),请告诉我。
您可以尝试此(如窗口间谍所示,用Teamcenter窗口的确切标题替换title of TeamCenter 10
):
F1::
; Retrieve the control name for each control in a window:
WinGet, List, ControlList, title of TeamCenter 10
; Examine the individual control names one by one, using a parsing loop:
Loop, Parse, List, `n
{
If InStr(A_LoopField, "SWT_Window02") ; use only the part of the control name that is always shown in Window Spy
ControlClick, %A_LoopField%, title of TeamCenter 10
break
}
return
https://autohotkey.com/docs/commands/winget.htm#controllist