Autohotkey 如何使用鼠标移动停止(或中断)脚本

Autohotkey 如何使用鼠标移动停止(或中断)脚本,autohotkey,Autohotkey,我正在为我的Indesign文档使用一些脚本。但我想在鼠标光标不移动时停止脚本。脚本运行时,鼠标在文本中移动(正常)。当文本完成后不再移动,但脚本仍在为循环完成工作。 当光标不移动时,我可以停止它吗。 这是我的脚本示例 Loop 100 { Send ^{Numpad3} Send ^{Down} Send ^{Numpad2} Send ^{Down} } 如果移动鼠标,将停止循环 MouseGetPos, x1,y1 Loop 100 { MouseGetPos, X2, Y2

我正在为我的Indesign文档使用一些脚本。但我想在鼠标光标不移动时停止脚本。脚本运行时,鼠标在文本中移动(正常)。当文本完成后不再移动,但脚本仍在为循环完成工作。 当光标不移动时,我可以停止它吗。 这是我的脚本示例

  Loop 100
{
Send ^{Numpad3}
Send ^{Down}
Send ^{Numpad2}
Send ^{Down}
}

如果移动鼠标,将停止循环

MouseGetPos, x1,y1 
Loop 100
{

  MouseGetPos, X2, Y2

  if (X1 <> x2) or (y1 <> y2)
    break


  Send ^{Numpad3}
  Send ^{Down}
  Send ^{Numpad2}
  Send ^{Down}
}
MouseGetPos,x1,y1
环路100
{
鼠标座,X2,Y2
如果(X1 x2)或(y1 y2)
打破
发送^{Numpad3}
发送^{Down}
发送^{Numpad2}
发送^{Down}
}

您到底想用这个实现什么?请详细说明你的问题。