barcode-to-pc-server
barcode-to-pc-server copied to clipboard
Enhancement request: Provide masking option copy function
Hi. I love this project. Very slick.
Proposal:
Add an optional copy mask that allows copying of only part of the scanned data. This can be used to remove vendor specific static data, leaving only the bit that identifies the item. My specific usage is to mask out carrier data, leaving only the satchel code required by the carriers tracking website.
Benefits
- Reduces double handling - on the Mac (at least) copy from BC2PC ignores the selected region and always copies the entire scanned string. If the destination field in the application is expecting just the satchel identifier, this string must be pasted into TextEdit (or similar) first, then the required component selected and copied before it can be pasted into the app.
- Increases accuracy - selecting the middle 22 digits from a 56 digit number is error-prone and requires care and double checking to ensure it is right every time.
Example
I use BarcodeToPC to scan postage satchel barcodes for my online store. The barcodes have a prefix that does not appear on the printed label. I presume it identifies the issuer of the barcode and therefore is not required when the tracking number is entered into the carrier's tracking page. This code is not very long, (18 digits in total) and I have been providing it to my customers in full.
My carrier (Australia Post) has recently started using a data matrix instead of a barcode. The scanned tracking number is now 56 digits - an 18 digit prefix, a 22 digit tracking number that is printed on the satchel's label and a 16 digit suffix. The prefix and the suffix appear to be static, based on the half-dozen new satchels I have scanned so far.
My enhancement request is for a capability to define a copy mask that detects a given prefix and suffix and copies only the unmasked bit. For example, with this number:
019931265099999891000300108002182988099448008181025153938
The split is:
019931265099999891 0003001080021829880994 8008181025153938
Where the middle group is the bit I need to attach to the carriers tracking URL to make a link for the customer. Currently, the full number is too long for my tracking code field to accept. I have to paste it into Notepad, then copy the middle bit without dropping or adding any unwanted digits. A copy mask would save me time and increase reliability.
I think that you can already do that with the substr component, like that:
Or if you need to do more complex string manipulation you can use all Javascript string functions: https://www.w3schools.com/jsref/jsref_obj_string.asp