Page 1 of 1

Reading QR-code on a Mac

Posted: Tue Feb 23, 2021 7:05 pm
by Klaus
Hi all,

can someone please give me some hints about how I can scann a qr code on my Mac via the MERGEXT stuff?
I created a stack with some scripts in the only card:

Code: Select all

## This is called from a button on the card
command BarCoden
   mergAVCamStartBarcodeReader
end BarCoden

on mergAVCamBarcodeFound tCode
   put tCode into fld 1
   mergAVCamStopBarcodeReader
end mergAVCamBarcodeFound
Of course I must be missing something, since I get an error after clicking my button -> control not yet created?
So what Do I need to add here? The docs are quite sparse!

Thanks a lot in advance!


Best

Klaus

Re: Reading QR-code on a Mac

Posted: Tue Feb 23, 2021 7:39 pm
by Klaus
OK, found something in the mailing list archives.

Code: Select all

command BarCoden
   mergAVRequestMediaAccess
   wait 500 milliseconds with messages
   mergAVCamStartBarcodeReader
end BarCoden

on mergAVCamBarcodeFound tCode,tType
   put tCode && tType into fld 1
   mergAVCamStopBarcodeReader
   mergAVCamDelete
end mergAVCamBarcodeFound
Hoewver I get an error: unavailable on this platform
with mergAVCamStartBarcodeReader ALTHOUGH the docs
state this should work on Mac and iOS!?

Re: Reading QR-code on a Mac

Posted: Fri Mar 26, 2021 1:19 pm
by Klaus
It turned out that this does not work due to a bug in the external:
https://quality.livecode.com/show_bug.cgi?id=23131