If you place a simple text field on a layout, sized large enough to show multiple rows of text, place the cursor in the field and scan your barcode over and over, do you get correct scans?
We use an MSR (Mag Strip Reader) with USB interface/keyboard emulation so it functions just like your barcode scanner. It reades multiple tracks of data off a California Driver's License flawlessly. It's set up with script triggers so that user only need swipe the card and the data appears in the field and then another script parses the scanned data into relevant fields.
The solution uses FileMaker 10 on Windows xp or 7 machines so their could be a difference in behavior due to different OS or FileMaker versions. But there are also known approaches to automating the scan that can result in dropped characters from the scan so the method used to automate scan could also need adjusting.
Our method is very similar to the method described in this thread: Need help writing script to integrate barcode scanning
Well before I implemented the barcode element into the database, I tried it with an empty page and it worked fine there. If I, however, use it on a page with quite a lot of fields and data, it starts dropping characters. I've already set the scanner to the maximum intercharacter delay (which is the main reason why characters could be dropped) to no avail.
I just tested it again, and there are no characters dropped on an empty layout with a single text field - something in FileMaker is causing the characters to drop when there's quite a lot going on on the layout I think.
I found the problem. It's "OnLayoutKeyStroke" which causes the characters to be dropped. This is highly annoying since it seems to be the only way to capture the barcode without making the user go into search mode manually. Tthe idea is that the user scans the barcode and the data shows up. I do this by making the Layout go into Find Mode, entering the barcode into the search field from the buffer, and then activating the filter.
Would there be a relatively easier way to do this without the OnLayoutKeyStroke trigger?
Please click the link in my previous post and read the description of the method used to automate barcode scanning.
From your description, I'm guessing that you are using that trigger to capture and process each character as it is scanned from the scanner. This is one of two ways that I know of that can result in dropped characters from a acanner. The thread I suggested, uses onLayoutKeystroke to put the cursor in the correct field to receive the scanned data, but does nothing else. Then a second script trigger is tripped to mark the end of the scan and initiate the processing of the scanned data.
I implemented the code as you gave it on that post but I run into the exact same problem: characters are being lost. When it goes to my field and exits the script, it just inserts incorrect data. My guess is that the "OnLayoutKeyStroke" script continues to scan - I'm going to try changing layouts instead the moment it receives any typing.
What method are you using to trip the script triggers?
OnLayoutKeystroke does continue to scan, but should exit without doing anything on each keystroke if the scanned text isn't the "trigger" text that requires a response.
I may need to check this issue with a copy of FileMaker 12. If I get the same results here, it merits an issue report as this would prevent us from upgrading--something we have been considering.