Jump to content
Droog0x

Send ENTER if tab pressed twice

Recommended Posts

Droog0x

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!

Share this post


Link to post
Share on other sites
Earthshine

can you tell us what scanner you are using and what you have tried, in code (put between the code <> tags when you post)?


My resources are limited. You must ask the right questions

 

Share this post


Link to post
Share on other sites
Droog0x

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.

Share this post


Link to post
Share on other sites
Earthshine

sweet. So does it all happen on the scanner or are Windows on a computer being used? Trying to figure out where AutoIT will run here, cause it sounded like it would run on the scanner.


My resources are limited. You must ask the right questions

 

Share this post


Link to post
Share on other sites
Droog0x

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.

Share this post


Link to post
Share on other sites
ViciousXUSMC
Posted (edited)

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
  • Like 1

Share this post


Link to post
Share on other sites
Droog0x

I could even settle for something that says if Add button is selected in 'Sheet2' window then send enter or something like that. Since the only time its highlighted is when I need it to be pressed.

Share this post


Link to post
Share on other sites
Earthshine

use the AutoIt Info tool to get that button's details and try some script to press it.


My resources are limited. You must ask the right questions

 

Share this post


Link to post
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

×