2015-04-02 27 views
0

关注远调用后立即:AHK(AutoHotkey的):以从的InputBox

inputbox,inv,Scan Invoice Number: 

我想借此从输入框,并到另一个窗口集中离开,但预期和前等待用户输入它的行为不继续下一行代码。有什么方法可以覆盖这种行为吗?

回答

1

InputBox使当前线程等待用户输入,因此挂起线程。在其他语言中,你会说Thread终止,并且一个ActionListener开始监听。通过直接在AutoHotkey中调用一个新线程无法主动实现多线程本身,但是,您可以按照documentation中的说明使用热键或定时子例程启动它。

我想出了以下解决方案为自己几次,据我所知这是最彻底的方法有:

setTimer, continueAfterInputbox, -100 ; a negative period indicates "run once only", after a sleep of 100 ms in this case 
inputbox, inv, Scan Invoice Number: 
;; do things with %inv% 

Return 

continueAfterInputbox: 
msgbox, do other cool things 
return