I have a Bluetooth barcode scanner connected to my Mac. I'd like to have a scan open a URL, something like: http://​example.com/page/?barcode

I was thinking I could somehow direct inputs from the scanner particular input device to a terminal script and figure the rest from there, but I can't seem to find any solution to this.

I'd be happy if someone could recommend an app to achieve this.

  • 1
    What kind of scanner do you have? Does it come with any software? – nohillside Nov 9 '16 at 9:03
  • I assume you want this to work when you scan and the keyboard focus isn't necessarily where you want it. Is the scanner configurable? You might be able to have it prefix the barcode with a keyboard shortcut to hook it into Automator and go from there. – soupisgoodfood Nov 9 '16 at 12:17

Most scanners have a programming interface in which you can not just setup how the scanner works and how the data is formatted, but you can also configure what keystrokes it sends (like Control sequences and extra text such as a URL)

I just grabbed a random programming guide for a random Symbol scanner to use as an example

So, from the Table of Contents, we can configure it to send "Control characters"

enter image description here

What you would need is to set up a global shortcut with Karabiner, Keyboard Maestro or ControllerMate (I personally use this) to launch a browswer with URL and barcode number as the address. You can even program in the Return keypress to go to the website automatically. It may have to be done in with some AppleScripting, depending on the complexity.

You could set it up so it sends a CtrlB, wait to allow your browser to loaunch and then and the text http://example.com/?xxxxxxxxxx

| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .