This is a pretty easy task in FM using script triggers. There are different ways to do this, but I guess I would do it like this:
1) Create a global field "BarcodeSearch"
2) Set up "OnLayoutEnter" (in the layout script triggers) to launch a simple script that would do "go to Field (BarcodeSearch)". If you want the cursor to stay inside at all time (even when clicking outside), you can use another trigger "OnObjectExit" that would lauch the same script that goes back to the field.
3) Set up OnObjectModify to launch a script that would search for that barcode in the ISBN field and empty the BarcodeSearch field. Make sure that you add a condition in your search script to "exit script" at the beginning if the BarcodeSearch field is blank.
I'm not sure 100% that this would work as I don't have a Barcode scanner, but this is definitely what I would try first.
I hope this will help.
I'll give it a try...
I have no "OnObjectModify" in my scripttriggers.
Can it have an other name?
It is much easier to use a custom dialog for scanning. The dialog could pop up when you open the DB and wait for scan. Then you script the procedure from there to create a recoord and do whatever else needs to be done.
At ZeroBlue we are here to help with Barcoding. We also sell barcode scanners, RFID readers and now mag swipe readers to swipe credit cards.
We can also implement Barcoding in your solution if needed.
agnes b. riley . filemaker and web development
T 201-299-6223 (NJ) . 212-842-8830 (NY) . 917-660-7221 (C)
FileMaker Certified in 10 and 11
There definitely is an OnObjectModify script trigger -- I've used it!
However, I've done the same basic thing you're trying to do with barcode scanners and I generally start the way Thomas suggests, with a global field on a pop up layout. There's a script trigger on the global field, which I usually set up as OnObjectExit.
The barcode scanner is programmed so that it sends data like this:
1. A Control+1 (or Command+1) on Mac. This runs the script that is in the first position on the Script menu. All it does is open a new window, go to the layout with the global field and put the cursor in the global field. This script first checks to see if there is a "Waiting for Barcode" window already open, and if so, selects that window and puts the cursor in the global field.
2. I generally program a string of nonsense characters, like "~~~~~" to slow things down a bit. If I don't do this, the first part of the real data is sometimes lost.
3. The actual data comes next.
4. Finally, program a tab or return key, either of which will trigger the global field's OnObjectExit script.
That script is the key to what happens next. It reads the contents of the global field and filters out everything except the characters I might expect (for ISBNs, that is probably just numbers 0-9, but I suppose could also include dashes) and stores the result in a variable. Once that is done, the global field is cleared. Then the script does whatever needs to happen next, which in your case would be using the variable in a find and displaying of found data.
for the helpfull answers.