Hi Rich,
A good ideia would be to do it all in batches instead of just one book at a time.
I've never worked with FM and barscanning together but if you manage to create a single FM, return delimited text, file with a bunch of your barcodes you are in business. Actually this script will also work with one record at a time. But you should grab a list of books, or make one as you go along, so you can capture loads of barcodes (and still know which book each barcode references

).
So considering you have all the barcodes in a single FM field in an out of system PARENT file, like this:
Barcode1
barcode2
...
barccoden
All you have to do is create a CHILD file and a relation from Parent->to->Child, with Allow creation of related records Set On.
This relation can be based on an simple field (with a constant in it) or a calculation.
Relation
k =:: k
You need these fields in Parent:
k(calculation=1)
gWordCount(Global, Number)
gLeftAllBarcodesCount(Global, Number)
YourRecordWithAllBarcodes(Text)
Put these fields in the Child File:
k(Text)
OneBarcodeRecord(Text)
Know it's easy:
Go back to Parent make a Portal to Child on the Portal put the child field OneBarcodeRecord.
\\--------------
Create the following script in Parent: "CreatChildBarcodes"
Go to Layout [with Portal]
Set Field[gWordCount, WordCount(YourRecordWithAllBarcodes)]
Set Field[gLeftAllBarcodesCount, "1"]
Loop
Go to Portal Row[Last]
Set Field[Relation::OneBarcodeRecord, MiddleWords(YourRecordWithOneFieldWithAllBarcodes; gLeftBarCodeCount; 1)
Set Field[gLeftAllBarcodesCount, gLeftAllBarcodesCount + 1]
Exit Loop If[gLeftAllBarcodesCount = gWordCount + 1]
End Loop
Go to Layout[original layout]
\\--------------
Don't Forget:
The Relation must Allow creation of records
The Script must run on the same layout as the portal (because of the "Go to Portal Row" step.
Good Luck
Bergson