尝试控制点击时出现 Ableton 问题

Ableton Issue while trying to control click

尽管我已经阅读了文档并观看了教程,但我是一个完全的初学者,所以如果这是一个愚蠢的问题,我深表歉意。我已经尝试了很长时间没有结果。

我想在 Ableton Live 中使用 NUMPAD0 键来按下全局录制按钮,但我不想通过鼠标坐标来实现(1. 因为 windows 在我需要录制时可能会被最小化并且2. 因为我想在未来实现这一点,以便能够在我创建它们时也能在单个轨道上按下录制按钮,例如,范围可能从 1 到 80 个新轨道)

问题是 Windows class 会动态变化,控件 ID 不会在 winspy 中显示。

这就是我一直在做的事情:

GroupAdd, Live, ahk_class 
Afx:0000000140000000:0:0000000000000000:0000000000900015:00000000007A04C3
GroupAdd, Live, ahk_class 
Afx:0000000140000000:0:0000000000000000:0000000000900015:0000000000200651
GroupAdd, Live, ahk_class 
Afx:0000000140000000:0:0000000000000000:0000000000900015:0000000000290651
GroupAdd, Live, ahk_class 
Afx:0000000140000000:0:0000000000000000:0000000000900015:00000000001E05F1

curMode := 1
return


Numpad0::
 SetControlDelay -1
 controlclick, ahk_group Live0,,,,,NA
 return

所以,我的问题是: 1. 在 GroupAdd 命令中,我放入了我见过的 window classes,但我相信可能会有更多 classes ,每次我打开一个新的 Ableton window 时都会出现。 2.在Control Click命令中,我没有输入控件ID,因为找不到。

关于如何完成此代码或将其更改为不同代码以便在不使用坐标的情况下按下 Ableton 中的“记录”按钮的任何建议?

编辑: 这是我现在正在尝试的代码,遵循了建议,但我还没有得到任何结果:

SetTitleMatchMode, Regex
SetTitleMatchMode, Slow

#IfWinActive, .*als
Numpad0::F9
#IfWinActive
return

这是它的第二个版本,它也不起作用

SetTitleMatchMode, Regex
SetTitleMatchMode, Slow

#IfWinActive, Afx:0000000140000000
Numpad0::F9
#IfWinActive
return

虽然我从未使用过 GroupAdd,但如果有有限数量的 Class 排列,在我看来你可以 RegExMatch 反对那些,然后在其中形成你的小组. GroupAdd 规范似乎使除 GroupName 之外的所有参数都是可选的,因此也许您可以在确认您获得正确的 window.

后跳过 Class 声明

示例:

WinGetTitle, Title, A
WinGetClass, Class, A
if (RegExMatch(Title, "Ableton Live.*") AND (RegExMatch(Class, "(AbletonClass1|AbletonClass2|AbletonClass3)")))
{
    ; Do stuff
}