most external scanners work like normal keyboards. EG the scanner types out each character in the string, rather than a copy/paste type action. The pause is to allow the string writing to the field to be finished by the scanner before continuing. If there is no interval set in the pause, then that's probably an issue.
If you do find hardware that has the copy/paste action rather than the string write, then you can remove the pause, however it's difficult to tell, and you could end up with cutoff numbers if you remove the pause without knowing 100%.
Yes, as you say the pause is necessary to give the scanner time to enter the whole barcode, then the user has to press enter to tell the script to resume. With most scanners you can program in a suffix, in the case of our USB scanner this is the enter key, to resume the script once the barcode entry is complete. With our bluetooth scanners though there is no option of an 'enter' key. There's carriage return or line feed or a combination of the two, or any letter combination. The problem is I don't know what to use to emulated the enter key. What is the enter key? By that I mean, what is the programming behind it?
If you just need to detect for the enter key being pressed, use the field based script trigger for OnObjectKeystroke,
and detect for the proper key as follows:
If ( Code( Get(TriggerKeystroke) ) = 10 )
Show Custom Dialog [ "Enter Key Triggered" ]
Else If ( Code( Get(TriggerKeystroke) ) = 13 )
Show Custom Dialog [ "Return Key Triggered" ]
Once you've established which code runs with your scanner, you can adjust your script accordingly to detect the proper code.
If you're looking at a standard qwerty keyboard with number pad. Code 10 should be the enter key in the bottom right of the keyboard by the keypad, Code 13 should be the return key to the right of the apostrophe/quote key.
In Unicode, the enter = linefeed and return = carriage return. That's covered here:
We've been trying to avoid onobjectenter as it requires splitting the script; it's much easier to have one looping script. However, this does answer the question of what the enter key is and might help point create the correct barcode suffix. If we figure it out I'll post the solution.
I second Mike B's advice. We have several bar code solutions, and do not attempt to pause the script. The original developer did that, and it caused all sorts of issues. It's a serious security vulnerability, because an external call via AppleScript or other external FileMaker source can issue a "Halt Script" or "Resume Script" command, leaving your solution in an indeterminate state.
Split the script. "Easy" isn't always the right answer.