this script goes over how to pad your scanned to a given number..
You need to have all scanned be a length of 12.
this script will shorten from the end all scripts longer than 12 or add 0's to the beginning of the scanned to make it a length of 12..
var len = event.data.length;
if (len < nLength)
// pad data with zeros upto length of 11 characters
for (i=0; i < (nLength- len); i++)
event.data = "0" + event.data;
else if (len > nLength)
event.data = event.data.substr(0, nLength) ;
Display Name: nLength
Description: limits barcodes to the length set by nLength
default value: 0
In the above screen shot the value of 12 can be edited to the value you need.