Handheld Barcode Scanner & Data Entry with AHK’s Part 3- Text to Speech for confirmation of input

I used sound frequencies to indicate input to different fields of the form. I demonstrated that to my daughter and she commented that it would be handy if it could tell you what had been scanned. I mentioned the SoundPlay function instead of the SoundBeep function, suggesting you could make small .wav files to play that had speech sounds of the terms used, and it could loop through what was scanned and play the appropriate file.

But it got me thinking, I’d downloaded and played with Capture2Text AHK app that allows you to extract text from an image, and as well, you can have the text read to you. MAKE SURE YOU UNBLOCK THE DOWNLOADED ZIP FILE before unzipping otherwise the .DLL files will all be blocked and the programme wont work correctly.

So I looked up a Text to Speech Go to (https://www.autohotkey.com/boards/vie…โ€‹) to see script for AHK TextToSpeech class code. I then added this to my script.

The video below explains the process:

I was very happy with the results, you can download the AHK script here.

Barcode scanner too far from dongle

So after getting that to work I started wondering about what happens when you are too far away from the dongle on the PC? So you are scanning and it doesn’t reach the Pc.

The scanner I have has a Storage mode that allows you to store information in the barcode reader and then send it to the dongle later. I saw somewhere that it can store up to 50,000 scans before its full. That is a lot.

So testing the storage mode out, I had to scan a QR code that set the scanner to StorageMode and then the scanner vibrated on each scan. It carried on vibrating when there was a successful scan.

I then opened an Excel worksheet, put the cursor in the first cell , and scanned an Upload Data QR code to the scanner. It just did one line of data that tabbed across cells and put each separate scan in the adjoining cell.

I then tried it with Notepad++ and Scanned Upload Data QR code and it sent the scans to the text file, but the space between each successive scan was not consistent. Some had a space between them and others joined together, so saving as a .TXT, .CSV or a .TSV file format made no difference, the data was not regularly spaced, and importing it into Excel sometimes 2 to 3 barcodes were all in the same cell.

So the moral to the story, for my particular scanner, upload to an excel spreadsheet (then you can save to .CSV file or .XLS file.

You do need to Clear Data (by scanning a specific QR code) after upload, otherwise that stored data will be downloaded in next upload Data scan .

Row requirements

As the barcode data just comes out all on one row, you need to set up a AHK script that will break the file down to 3 scans (plant_ID, condition, Height) and then move the rest of the data down to a new line, so restructure the file data so that its compatible with the data going straight from scanner to Dongle.

You will most probably have to have a pop-up box to say how many scans to a row, so that it restructures the file correctly, so the information can be appended to the original file.

I haven’t done this yet, but its an idea in the works. I want to be able to go outside to my external plants and that is too far away from PC (although I could take it as tablet only out there.

So, good to learn the foibles of the scanner. I’ll need to do a script that will manage this method of data collection.


Also you need to upload it straight away so that you have correct date/time of when the scans occurred and also add user data to the script too.

End comment

I got a little distracted when testing Storage mode on scanner because I wanted to try out the NFC (near Field Communication) sensor on my new phone and that started another thread. I’m starting to write a post on that.

The Storage Mode extends the usefulness of the barcode scanner, but I think, if you are having to use it in this mode a lot I’d look at having the tablet on a strap with the dongle in it instead. The reasoning with this is that with dongle close by its scan and go. With Storage mode you have to do post-processing to reorganise and append data.