4 Replies Latest reply on Jan 16, 2012 11:48 AM by EssexBiker

    Stuck - Well the cursor is!  Navigation script help needed


      I do hope that some kind soul would be able to help me.


      I have a bluetooth barcode scanner which I can pair with my Mac/ Ipad


      I have looked at forums and attempted to use a script provided my PhilModJunk but struggled even though I have been able to program the scanner. To be honest, I don't think that my problem is to that end of the business it's more what happens when the data is passed into the layout.


      Here's a screen grab showing my current version of the script and layout.





      Screen Shot 2012-01-15 at 21.49.17.png


      Data is scanned and populates the global field (I have to click into that manually to begin with)


      That then in turn populates the Scan_StudentID field allowing me to view related data form elswhere in the database...


      What I cant get to happen is from Scan_StudentID for the cursor to go back into that gScanInput field to start all over again. Of course when the data is passed from the gScanInput to ScanStudentID there's no Return/Enter/Tab to move out of that field.




      I can click into the global field manually but that's not really the plan!


      Any one got any ideas to save me another weekend infront of the Mac tinkering?

        • 1. Re: Stuck - Well the cursor is!  Navigation script help needed

          What about a script trigger to commit the record and then go to the field? Make sure the field is set to select contents.

          1 of 1 people found this helpful
          • 2. Re: Stuck - Well the cursor is!  Navigation script help needed

            I think I have done it!  All flippin weekend (well most of it) and then in a eurka moment just before I went to bed......


            I noticed that when the data was passed  from the global to the Scan_StudentID it was actually putting return.. Problem was the use return/ Tab/ Enter didn't work because there was nowhere in the body to go.  I placed a tiny gScan_StudentID in the body and then from there set and On Object enter with a script to set selection to the gScan_StudentID in the header.


            Its probably very messy, but it seems to work......


            It'll do for me


            Thanks David.  I will try yours though and keep you updated.

            • 3. Re: Stuck - Well the cursor is!  Navigation script help needed

              Hi EssexBiker,


              If I understand correctly, you should be able to avoid the problem more simply by making a minor change to your ScanScriptv2 script.


              As it's presently written, the script includes a Go to Field[Scan2::Scan_StudentID] step. However it appears that this Go to Field[ ] step is redundant and, once removed, should enable the process to work without the focus ever being taken away from the gScangInput field. If so, deleting that step would be a rather simpler solution than the one you've implemented.


              Also, FWIW, the syntax of the calculation on the first line of your script (in the If[ ] step) is incorrect. It appears that the intent of the If[ ]/Exit Script[ ]/End If sequence of steps was to exit the script if the trigger keystroke is anything other than 13 (Return) or 10 (Enter), however as written the expression will always return false. So, in its present form those first three steps are redundant and the script will run for all trigger keystrokes.


              Consequently, you might consider either changing the If[ ] calculation to one that is valid or deleting the first three steps.


              If you decide to try the script with the first three steps working as it appears they were intended to, you would need to change the calculation to separately check for Enter and Return - for example:


              If[ Let(keystroke = Code(Get(TriggerKeystroke)); keystroke ≠ 13 and keystroke ≠ 10)]


              Alternatively, if you delete the first three steps and also the Go to Field[ ] step, as suggested above, you will end up with a considerably shorter script.  ;)





              R J Cologon, Ph.D.

              FileMaker Certified Developer

              Author, FileMaker Pro 10 Bible

              NightWing Enterprises, Melbourne, Australia




              • 4. Re: Stuck - Well the cursor is!  Navigation script help needed

                Fabulous.... Thanks very much indeed.


                Perhaps I should pay more attention to that book of yours I bought last year



                Kind regards from a very cold Blighty