A barcode scanner like the LS2208 works just like a keyboard and functions parallel to your keyboard. You do not have use insert form device or anything like it. Have the cursor active in the field where you want the result to be entered and scan.
how to write a script that would be triggered by the scanner.
Follow the configuration guide that comes with the scanner to program it to add a "tab" after the end of each scan (called a postamble or scan suffix)
Or print and scan these instructions: https://www.barcodesinc.com/news/?p=507
Use a script trigger to run your script.
Thank you, that's so much simpler than I expected! I do have one other question-- is there a way to indicate in a script that I want it to perform an action if a particular "keyboard" (in this case, the scanner) sends a keystroke?
Ideally, what I'd like to happen is when someone scans a barcode, it performs a find for that item automatically. I'm concerned about the possibility of overwriting data if someone scans something without manually triggering a find script or entering find mode.
I have a script trigger on the field field that checks for exiting the field (the LS2208 send either a "tab" or a "return" after scanning, this can be programmed in the scanner).
I have that field set up to exit after "tab" and after an "enter" or "return". The script then uses the contents of the field as a parameter.
1 of 1 people found this helpful
You could try setting up the scanner with a preamble/prefix that fires a key command that activates a script (similar to the postamble/suffix mentioned above). That script would simply go to the scanning field, which would be a global field. You may also have to program a "pause" as an additional prefix to give the script a moment to get to the target field before the scanner sends additional characters.
Then at the end of the scan, you'll follow my advice above to run a script.
If you want more control, you need to use a serial barcode scanner with Troi Serial Plug-in. Then it doesn't matter where the cursor is or whether there is a designated scanning field on the layout. The script runs and receives the scanned data, then you can program whatever checks you want to determine what to do with it.