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 

Loop Copy & Paste

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



Joined: 16 Mar 2008
Posts: 22
Location: Brooklyn

PostPosted: Sun May 11, 2008 7:18 pm    Post subject: Loop Copy & Paste Reply with quote

I'd like to create a loop to copy items and another to paste them. For the sake of simplicity, I've put them together so it will just copy and recall it to the Message Box. The following code turns the Clipboard contents into a variable called varItemNumberx (IE varItemNumber1, varItemNumber2, varItemNumber3...)

I can't figure out how to recall an entire list without actually typing out varItemNumber1, varItemNumber2. I know its simple, but driving me nuts!!

Code:
^F11::
Loop %varLoopRegSales%
{
Sleep, 50
Send, {ENTER}
Send, {CTRLDOWN}c{CTRLUP}
Sleep, 50
varItemNumber%A_Index%:=Clipboard   : ------Setting the variable works fine
Msgbox, %varItemNumber1% : ------ Recalling it requires that I explicitly write that number.


I tried, the following code, but it just yields a single number response.
Code:
Msgbox, %varItemNumber%%A_Index%

_________________
Back to top
View user's profile Send private message
Z Gecko
Guest





PostPosted: Sun May 11, 2008 7:28 pm    Post subject: Reply with quote

try:
Code:
^F11::
Loop %varLoopRegSales%
{
Sleep, 50
Send, {ENTER}
Send, {CTRLDOWN}c{CTRLUP}
Sleep, 50
varItemNumber%A_Index%:=Clipboard   : ------Setting the variable works fine
Msgbox % varItemNumber%A_Index%
Back to top
Sergio



Joined: 16 Mar 2008
Posts: 22
Location: Brooklyn

PostPosted: Sun May 11, 2008 7:47 pm    Post subject: Thanks Reply with quote

I'm so glad I asked because the space between the first percentage and the variable name is counterintuitive. It works like a charm. Thanks!
_________________
Back to top
View user's profile Send private message
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