The second set kicks off with Ctl Alt V and it enters the variables into QuickBooks. It's working Except for the "qbacct" variable. For some reason that I can't figure out it reuses the first iteration for the 2nd iteration's "qbacct" value. It's only the 2nd iteration. Everything else works fine, and that's what's perplexing. Usually it's a nothing works or everything works deal, not an arbitrary, just this guy doesn't work.
I did my best to show the Excel set up and the AHK result below, and attached a sample of my Excel file just in case. The second line in the result should be "02.10 Fill Dirt", but instead it's returning "02.30". Any ideas?
From Excel:
- Pro Touch A-02 02.30 Land Clearing Inv 6494 2100.00
Pro A-02 02.10 Fill Dirt Inv 6494 2700.00
Pro Touch A-02 02.30 Land Clearing Inv 6494 650.00
Pro Touch A-02 02.40 Grade Pad Inv 6494 350.00
Pro Touch I-18 02.60 Rough Grade Inv 6493 200.00
Pro Touch R-01 02.60 Rough Grade Inv 6495 200.00
- 02.30 A-02: Inv 6494 - 02.30 Land Clearing 2100.00 A-02
02.30 A-02: Inv 6494 - 02.30 2700.00 A-02
02.30 A-02: Inv 6494 - 02.30 Land Clearing 650.00 A-02
02.40 A-02: Inv 6494 - 02.40 Grade Pad 350.00 A-02
02.60 I-18: Inv 6493 - 02.60 Rough Grade 200.00 I-18
Code: Select all
^!C::
InputBox, copies,Bills Register Copier,How many lines need to be copied?`nCursor goes on the vendor name.
Loop, %copies%
{
clipboard =
Send, ^c
ClipWait, 100
vendor%A_Index% := RegExReplace(Clipboard,"\s*$")
clipboard =
sleep, 100
send, {tab}^c
ClipWait, 100
jobnum%A_Index% := RegExReplace(Clipboard,"\s*$")
clipboard =
sleep, 100
send, {tab}^c
ClipWait, 100
qbacct%A_Index% := RegExReplace(Clipboard,"\s*$")
clipboard =
sleep, 100
send, {tab}^c
ClipWait, 100
Invoice%A_Index% := RegExReplace(Clipboard,"\s*$")
clipboard =
sleep, 100
send, {tab}^c
ClipWait, 100
amt%A_Index% := RegExReplace(Clipboard,"\s*$")
clipboard =
sleep, 100
Send, {tab}{enter}
if (a_index = copies)
break
}
return
Code: Select all
^!V::
Loop, %copies%
{
amt := amt%a_index%
invoice := invoice%a_index%
jobnum := jobnum%a_index%
qbacct := qbacct%a_index%
StringLeft,qbacct2,qbacct,5
sendinput, %qbacct2%
sleep, 550
SendInput,{tab}%jobnum%: %invoice% - %qbacct%
Sleep, 650
SendInput, {tab}%amt%{Tab}%jobnum%
Sleep, 550
SendInput,{tab}
if (a_index = copies)
break
}
return