Jump to content

Send ENTER if tab pressed twice


Recommended Posts

I'm scanning in 1,000s of devices because former management didn't know documentation was a thing. I have an excel spreadsheet with a form that has 2 fields. One for MAC and another for Serial #. The scanner I'm using is programmed to have TAB as the suffix after each scan. So I scan the Serial, it auto tabs to the MAC field, then auto tabs to the Add button. Currently I have to hit enter on the keyboard to Add it to the spreadsheet and then the process repeats itself.

Is there a way for autoit to send ENTER after tab is detected a second time? Or possibly to hit enter when the Add button is highlighted? I cant do a timed key press because the bar codes are tiny and the time it takes to scan isn't guaranteed. Ideally the script would send enter after every other scan. I'm not sure if AutoIT would detect tab from the scanner in the same way it would from the keyboard though. This has me stumped, any and all help would be appreciated!

Link to comment
Share on other sites

I'm using an IDautomation SC5USB-W wireless scanner. I haven't tried any code yet, I was looking for a place to start. The scanner is programmed by scanning a sequence of barcodes in the manual. It can be programmed to do a lot of things but the problem is I need it to alternate between functions and I dont believe that's possible with the scanner. You can add a prefix or suffix to the scan and currently i have Tab set as the suffix. So right now my process is Scan>Auto tab via scanner>Scan>Auto tab via scanner>Then manually the enter key. Then the cursor goes back to the first field ready for another barcode to be scanned. I'm trying to eliminate that manual key press.

Link to comment
Share on other sites

I'm scanning into excel using the form feature. So theres a little window with a field for each column, scan SN into SN field, it tabs to MAC field, scan MAC then it tabs to the Add button. I hit enter and it adds it to spreadsheet. Then fields clear and cursor goes back to SN field. I'm scanning my desk and hitting enter manually, If I could be scanning on a long table behind me without having to hit enter it would drastically speed things up.

Link to comment
Share on other sites

If you want the function that is exactly what you are asking for this is pretty much it, you may have to tweak it a tad (add another tab or sleep or something).

Seeing the process there is probably a better more programmatic way to do it rather than raw key strokes, but if it helps atleast its a place to start.

 

#Include <HotString.au3>

HotStringSet("{TAB}{TAB}", mycustomsend)

While 1
        Sleep(10)
WEnd

Func mycustomsend()
    ;Maybe Add Send Tab?
    ;Maybe Add Sleep to wait for scan?
    Send("{ENTER}")
EndFunc

 

Edited by ViciousXUSMC
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...