3 Replies Latest reply on Dec 11, 2013 9:19 PM by philmodjunk

    Scanner Assistance Please

    AdamSadow

      Title

      Scanner Assistance Please

      Post

           Afternoon all,

           Using FMP 11 Adv. on Mac OS 10.7.5.  Trying to do the following with a scanner: 1) scan a student id barcode which will then put the layout into find mode, input the student id into that field, then bring up the the student's information, then send the cursor to another field on the page in browse mode.  I basically need help I think with the script; I already know how to create unique student ids in barcodes.

           Hope I am making sense,

           Thank you,

           Adam

        • 2. Re: Scanner Assistance Please
          AdamSadow

               Phil,

               Thanks for the reply. The scripts you suggested (below), they are put into separate scripts which are then selected by the script triggers, right?

               If so, I started the scripted with "If" then clicked "Specify."  I pasted the script in, minus the "If" and "Exit Script [False]"  When I do, first the pop-up tell me that a "(" is expected instead of the first "[" then it tells me I have more "(" than ")" so I change the end of the 1st line's "[" to ")".  Then a pop-up tells me that "The specified table cannot be found" for "Go to Field"

                

               Thank you,

               Adam

                

                


               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

          • 3. Re: Scanner Assistance Please
            philmodjunk

                 When you add the If step and click specify, you would only enter or paste the boolean expression, the text between the square brackets.

                 You can copy and paste a calculation, but you can't paste the entire script.

                 To add the other steps, you'd add them just like you added the If step.

                 And keep in mind that the precise expressions used in some of these steps also depend on how you configure your scanner.