Autohotkey 从工具提示中获取控制权

Autohotkey get control from tooltip

我需要找到其工具提示链接到的控件的名称。 我问这个是因为我需要在 TeamCenter 10 中控制单击,但是当您单击其中任何一个时,控件名称会不断变化。当我需要重复任务时,这使得我的代码 运行 很难顺利进行。

如果有更好的方法(在 Autohotkey 中),请告诉我。

您可以试试这个(将 title of TeamCenter 10 替换为 TeamCenter window 的确切标题,如 Window 间谍中所示:

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