Long-term, nearly anything is possible, however, an important part of your question is that you’re using a script to initiate barcode scan; there’s no scripting API for that functionality at this time.
If our solution is to only add the appropriate scripting calls (
system.perspective.scanBarcode() ), what you would most likely do is something along the following lines:
- In your View’s onStartup Event, perform
self.view.custom.scan = int(self.view.custom.scan) + 1
- Provide an OnChange Script for the view.custom.scan property, and have that script invoke the barcode scan.
If our solution is instead to provide an Event more along the lines of onViewLoad, then you would be able to simply use the Scan Barcode Action when the Event occurs.
One last thing, just for clarity: the blocking factor here is not timing, so the 1-2 second wait will not alleviate anything - the blocking factor is where the script executes (even though it’s a View’s onStartup Event, the script will execute on the Gateway), combined with the limitations in what the Gateway can do vs what the Session can do (the Session can request access to the camera, but the Gateway is unable to do so).