AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Getting input using MsgBox and perorming operations

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Bhattaram
Guest





PostPosted: Tue Jun 26, 2007 7:29 am    Post subject: Getting input using MsgBox and perorming operations Reply with quote

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





PostPosted: Tue Jun 26, 2007 11:02 am    Post subject: Reply with quote

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 :)

PostPosted: Tue Jun 26, 2007 11:07 am    Post subject: Reply with quote

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
View user's profile Send private message
Helpy
Guest





PostPosted: Tue Jun 26, 2007 3:30 pm    Post subject: Reply with quote

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





PostPosted: Wed Jul 25, 2007 12:57 am    Post subject: Reply with quote

Try Oberon Object tiler
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group