2 Replies Latest reply on May 21, 2014 12:39 PM by philmodjunk

    Need help writing script to integrate barcode scanning

    NiceData

      Title

      Need help writing script to integrate barcode scanning

      Post

           Looking for help or willing to pay someone to help us integrate our barcode scanner with Filemaker Pro. Our project starts next week and its a very simple application. We just have a very low level knowledge of Filemaker scripting and need this done asap. We don't have much time to try to learn this ourselves.

           This is the barcode scanner we're working with: http://idautomation.com/cart/IDAutomation-SC1500-USB-Barcode-Scanner-P1205.aspx

           And this is a tutorial that may help in figuring out how to integrate that particular scanner with Filemaker: http://www.idautomation.com/scanenable/

           Here's the outline of what we need done:

             
      1.           Run script
      2.      
      3.           Filemaker enters Find mode and goes to ID field to await barcode input
      4.      
      5.           We scan item's barcode ID
      6.      
      7.           Filemaker then searches for that item and then inputs some pre-defined text into a few fields for that item
      8.      
      9.           Filemaker then returns to find mode and awaits another barcode input

           I actually already have a script made to input the pre-defined text into various fields, however, I don't know how to tell filemaker to respond to the barcode nor how to repeat the script so we don't have to keep running the script over and over again. 

           Thanks

        • 1. Re: Need help writing script to integrate barcode scanning
          philmodjunk

               Please note that I have not accessed either of the two links that you have posted.

               Your scanner almost certainly operates in what is known as "keyboard emulation mode". That means that data scanned by the scanner is recieved by the computer just as though that data had been typed in from the keyboard.

               This can be very useful for integrating a scanner with FileMaker.

               Assuming that you have FileMaker 10 or newer, you can set up script triggers to respond to the scanner.

               First task is to check your documentation that comes with the scanner or contact the company's techsupport to learn how to configure your scanner to put additiona data at the beginning and end of the scanned text. The script triggers you set up in FileMaker will run scripts that detect those characters and respond accordingly.

               Let's say you configure your scanner to append the Shift, capslock and ~ keys to the beginning of the scan. Whatever key combination that you can use, pick a combination that is unlikely to be pressed during regular use of the keyboard nor text that is actually part of the scanned data.

               The first trigger just detects this key combination and puts the cursor in the correct field to receive the scanned data:

               Set up the OnLayoutKeystroke script trigger to do this:

               If [Get ( TriggerKeyStroke ) = "~" and Get (TriggerModifierKeys) = 3 ]
                  Go to Field [YourTable::FieldForScannedData]
                  Exit Script [False]
               End IF

               The Exit script [False] step prevents the data that tripped the script trigger from being entered into the specified field.

               The Second trigger will process your data. Configure your scanner to put a return, Enter or tab character at the end of the scanned data. Use Field behavior on your scanned Data field to set it up so that this key exits the field. Then you can use the OnObjectExit or OnObjectSave trigger to perform your script that processes the scanned data:

               Go To layout [specify the layout where you need this to happen if not the layout where you have your scanned field]
               Enter Find mode [] ---> clear the pause check box
               Set Field [YourTable::DataField ; YourTable::ScannedData ] ---> ScannedData must have global storage speciifed or this script won't work
               Set Error Capture [on]
               Perform FInd []
               If [ Not Get ( FoundCount ) // error: no records found]
                  Show Custom Dialog ["No record was found"]
               Else
                 #put the rest of your script here
               End If

          • 2. Re: Need help writing script to integrate barcode scanning
            philmodjunk

            Note to Readers:

            This is a very old posting and questions posted to it no longer pop it up in to Recent Items. If you have a question about it, post your reply back to the thread that referred you here or start a new thread that includes a reference to this thread and post your question there.