how can I add a script in ANY format, and let Filemaker wait for input, even if it does regular operations ?
Please provide some more information here. What are the different formats you are expecting? What makes an operation regular, or not?
I have around 250 formats, any of these shows something different from database, as usual.
Than I also have a menu format, and some sub menus.
Some of these formats have already a script when user enter or exit them, just as example a format calculate how many phone calls are waiting and so on...
So, I'd love to input barcode from any point of the database, even if the user is in a different format/table than the one that contains value from scanner.
If I scan, I go directly to a format, and than to a record. From everywhere.
Hope this is clear, thanks
okay, so by format, you mean layout. You must have a field to receive the scan on any layout that the user is on when scanning. If this field is not selected when scanning, you will get an error. In the past, I've had a dedicated layout with one global text field to receive the scan. From there, I used a script to handle the scanner input.
I don't currently have a scanner to test, but it may be possible to program your scanner to prepend (add a prefix) to your scan that "types" ctrl-1, for example, to fire the first script in your script menu.
In the past, I've used onlayoutkeystroke to listen for scanner input. I set up the scanner so that the first characters input are very unlikely to be pressed on the keyboard.
If the script detects that character sequence, it would put the cursor in the correct field to receive the scanned data. If not, it did nothing and the data is passed on to whatever field currently has the focus.
I played with the OnLayoutKeystroke trigger, and almost suggested it. But I began to worry about speed. I don't know if the keyboard buffer lies in the keyboard, or the computer. Anyhoo, if it was an issue, I believe that many scanners can be programmed to place a time-delay between the scanned characters as they are sent.
You can also use Install OnTimerScript to manage a delay on FileMaker's part, but I didn't need it my case. The key is to keep the trigger performed script very simple and short so that it just passes the text on except for when the needed "flag" character or character sequence is input and then it just does a go to object or go to field and exits...
Many good solutions, but in every case, except the CTRL+1, I need to place the script trigger on EVERY field in every layout, isn't it ?
The CTRL+1 is a good solution, but I am not sure I can program the scanner barcode with this pre-code. It is barcode scanner Atlantis A08-C100, and I don't see this on the reference manual. i will try to ask to the hardware house is it is possibile.
No, you place the trigger on the layout.