8 Replies Latest reply on Nov 23, 2016 12:06 AM by philmodjunk

    Waiting for input from scanner barcode

    lolli_group

      I've already setup my barcode scanner to find a code in a single format, of a table.

      I use the same global field that I used before when the search was made writing the code by keyboard.

       

      I'd like to have a script that can "listen to" any input from barcode scanner, and in the case of particular code opens a mask or another.

      No problem for the script, but how can I add a script in ANY format, and let Filemaker wait for input, even if it does regular operations ?

       

      I can give a CR to the scanner, and I did this to activate the global field to search in a particular format of the database.

       

      Is it possibile to do something like this ?

       

      P.S.: attached you see the field I use now, but to use it I need to open the format and set field for input, of course.

        • 1. Re: Waiting for input from scanner barcode
          David Moyer

          Hi,

          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?

          • 2. Re: Waiting for input from scanner barcode
            lolli_group

            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

            • 3. Re: Waiting for input from scanner barcode
              David Moyer

              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.

              • 4. Re: Waiting for input from scanner barcode
                philmodjunk

                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.

                • 5. Re: Waiting for input from scanner barcode
                  David Moyer

                  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.

                  • 6. Re: Waiting for input from scanner barcode
                    philmodjunk

                    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...

                    • 7. Re: Waiting for input from scanner barcode
                      lolli_group

                      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.

                      • 8. Re: Waiting for input from scanner barcode
                        philmodjunk

                        No, you place the trigger on the layout.