I am new here and this is my first post in this forum and hope that I would get the help that I am looking for.
I am trying to insert a specific block in AutoCAD program with the use of AutoHotKey scripts and I successfully wrote a working script as posted below but the problem that I am facing is that I need to the script to wait for the user to specify the insertion point then repeat the process as per the loop number which is 3 in my example.
The user may take a few seconds before specifying a point but it seems is that the script does not wait for that time then it moves to second loop then to third then the user has only one repeat ( loop ) and not 3 as stated in the script.
Besides all of that, I would like to remove the Sleep, 100 to let the scripts invokes the command as soon as the user picked a point on the screen and not to wait for that 100 of seconds.
Anyone can help me with those two problems and find a work around?
Thank you.
Code: Select all
^k::
num := 0
Loop
{
if (num = 3)
break
else
{
Send, INSERT {ENTER}
Sleep, 100
Send, MyBlock
Send, {TAB}
Send, {TAB}
Send, {TAB}
Send, {TAB}
Send, {TAB}
Send, {TAB}
Send, {TAB}
Send, {TAB}
Send, {TAB}
Send, {TAB}
Send, {ENTER}
Sleep, 5000
num++
}
}
ExitApp