尽管我读过文档和看过教程,但我是一个完全的初学者,所以如果这是个愚蠢的问题,我很抱歉。我已经尝试了很长一段时间,但没有结果。
我想让NUMPAD0键按下Ableton中的全局记录按钮,但我不想通过鼠标坐标(1。因为当我需要记录和2时,窗口可能会最小化。因为我希望在将来实现这一点,以便在创建时也能在单个曲目上按下录音按钮,例如从1到80首新曲目)。
问题是,Windows类会动态更改,而控制ID不会在win间谍中显示。
这就是我一直在做的:
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命令中,我放置了我所见过的窗口类,我相信每次打开新的Ableton窗口时都会出现更多的类。2.在Control命令中,由于找不到控制ID,所以我没有放它。
对于如何完成这段代码或将其更改为不同的it,以便在不使用坐标的情况下按下Ableton中的记录按钮,有什么建议吗?
编辑:这是我现在正在尝试的代码,下面是一些建议,但我还没有得到任何结果:
SetTitleMatchMode, Regex
SetTitleMatchMode, Slow
#IfWinActive, .*als
Numpad0::F9
#IfWinActive
return这是它的两个版本,也不起作用。
SetTitleMatchMode, Regex
SetTitleMatchMode, Slow
#IfWinActive, Afx:0000000140000000
Numpad0::F9
#IfWinActive
return发布于 2017-09-12 17:23:25
虽然我从未使用过GroupAdd,但如果有有限的类排列,在我看来,您可以针对这些排列进行RegExMatch,然后在其中组成您的组。GroupAdd规范似乎使GroupName之外的所有参数都是可选的,所以在确认有正确的窗口之后,也许可以跳过类声明。
示例:
WinGetTitle, Title, A
WinGetClass, Class, A
if (RegExMatch(Title, "Ableton Live.*") AND (RegExMatch(Class, "(AbletonClass1|AbletonClass2|AbletonClass3)")))
{
; Do stuff
}https://stackoverflow.com/questions/46145001
复制相似问题