At work today I was asked to take a look at a spreadsheet that need a lot of extremely repetitive data added to it.
I started working on it right away, but after a hundred or so lines out of 1,700 or more, I realized that there HAD to be a better way.
So I turned to my old standby of AutoHotkey, except I wasn’t sure of how to create the script I needed at this point…
I did a bit of research after a coworker suggested I just use a combination of a variable with either pre or post incrementation, so I did a quick Google search for what I needed and I was able to come up with the following.
x:=0
NumpadDot::
LOOP 425
{
SLEEP 300
SEND 00
SEND % ++x
SEND CASHIER
SLEEP 300
SEND {ENTER}
SLEEP 300
SEND 00
SEND % x
SEND MANAGER
SLEEP 300
SEND {ENTER}
SLEEP 300
}
RETURN
This script was triggered by the period/dot key on the number pad and looped itself until it hit the end of the document. I paired this with another (extremely similar) script to run though all the rows automatically and add the data that I needed. This little bit of research and learning that I did, and the few minutes it took to write the script saved me HOURS of work, without a doubt.
Be First to Comment