| View previous topic :: View next topic |
| Author |
Message |
Bhattaram Guest
|
Posted: Tue Jun 26, 2007 7:29 am Post subject: Getting input using MsgBox and perorming operations |
|
|
I am using CorelDRAW 11 for designing.
Many times I have to duplicate an object several times.
The key strokes used are
Control D
The above two key strokes (Control and D) places a duplicate at a specified distance.
Some times I have to place duplicates as many as 3000 to 4000 times.
I found that the using Auto Hot Key the following commands will place the duplicate once.
| Code: | #R::
Send, {CTRLDOWN}d{CTRLUP} |
If I want more I have to create a ahk file with so many lines of
Send, {CTRLDOWN}d{CTRLUP}
Instead, is it possible to display a message box, get the number from user and do the action so many times.
Can any one give the code to accomplish this task ?
seena |
|
| Back to top |
|
 |
Helpy Guest
|
Posted: Tue Jun 26, 2007 11:02 am Post subject: |
|
|
Easy enough.
| Code: | #r::
InputBox repeat, Duplicate, Number of duplicates?
Loop %repeat%
Send ^d
Return
|
|
|
| Back to top |
|
 |
Fuco
Joined: 21 Mar 2006 Posts: 49 Location: Slovakia, Europe :)
|
Posted: Tue Jun 26, 2007 11:07 am Post subject: |
|
|
you should add some delay ( sleep ) between sends, because it may really screw up program...
so it should be like this:
| Code: | #r::
InputBox repeat, Duplicate, Number of duplicates?
Loop %repeat%
Send ^d
Sleep 100 ; <= new line: wait for 100 miliseconds.. you can change this to optimal value ( time what corel need to create duplicate, so you dont flood it with so many keysstrokes )
Return |
|
|
| Back to top |
|
 |
Helpy Guest
|
Posted: Tue Jun 26, 2007 3:30 pm Post subject: |
|
|
Or just use SetKeyDelay...
Note: you missed braces:
| Code: | #r::
InputBox repeat, Duplicate, Number of duplicates?
Loop %repeat%
{
Send ^d
Sleep 100
}
Return
|
|
|
| Back to top |
|
 |
lef Guest
|
|
| Back to top |
|
 |
|