Until now, if I saw a QR code (or certain other kinds of codes) on my Mac's screen, I would have to point my iPhone at it in order to read it and/or take action. No more!
This pair of macros will handle everything for you. If your screen contains any QR codes (or certain other kinds of codes) triggering this macro will find them, read them, decode them, let you choose which one you want to open (if there're more than one), prompt you for confirmation (which you can remove, since most apps already confirm these actions) and then it will open the app that is assigned to that QR code prefix.
It also supports the importation of VCARDs, which is cool, but in order to do this it places the VCARD file on your desktop. It leaves the VCARD there, in case you need it, but perhaps it should automatically delete that file. I could add that feature if people want it, but this is how I want it to behave.
The second macro is just a small utility that allows itself to be called asynchronously to let the parent macro simultaneously highlight all QR codes in your screen. I think my next project is going to be writing a Swift action to improve on the KM Highlight action, which has limited features.
More than half of this macro was written by myself. The Swift half was written mostly with Gemini AI, but I had to help it out, since Gemini makes a lot of mistakes.
You can change the Hot Key, but CTRL-Shift-Q (standing for "QR code") seems like a good starting point.
Once again, this macro demonstrates the amazing power of Swift code, which in this case is supplemented by a lot of KM code. Perhaps the KM code could have been written in Swift, but I still prefer using KM when it has the capability to solve a problem.
Test Swift Demos Macros (v11.1.1)
Test Swift Demos Macros.kmmacros (31 KB)