5 Replies Latest reply on Nov 25, 2015 5:18 AM by Mike_Mitchell

    Pause/Resume script step and bluetooth scanners


      I am trying to set up a bluetooth scanner to work with filemaker.

      We currently have a scanner with a USB cord which has 'enter' as a suffix.

      There is a looping script that pauses to allow barcode entry, then resumes with the enter suffix.

      However, for some reason no bluetooth scanner seems able to resume a paused script. We can program a wide variety of characters, both terminators and suffix but none of them work.


      The question is, what is a filemaker script waiting for when it is paused?


      I've tried <CR>, <LF>, <CR&LF> as well as a variety of others but haven't hit the magic combination. Unfortunately there is no setting for 'Enter'. I called Apple and they said the enter key differs by application so only filemaker would be able to answer this question. With no filemaker help desk to call I am totally stuck. The barcode company is also unable to figure out what will duplicate the enter key filemaker needs. On a bluetooth keyboard <Fn> <CR> works but of course scanners send keys individually and programming function and return sequentially didn't work.


      Yes, there are ways around this and I notice that custom dialogs on an ipad now enter a field without you needing to tap on it (new in FMGo 14?) so they would do in a pinch. Our first choice of solution though is to stick with this looped script as it is universal to all machines (desktops and ipad) and scanners that the company owns.

        • 1. Re: Pause/Resume script step and bluetooth scanners

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

          • 2. Re: Pause/Resume script step and bluetooth scanners

            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?

            • 3. Re: Pause/Resume script step and bluetooth scanners

              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" ]

              End If

              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:

              • 4. Re: Pause/Resume script step and bluetooth scanners

                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.

                • 5. Re: Pause/Resume script step and bluetooth scanners

                  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.