Trouble with pic2shop scanner script

Discussion created by DDoughtie on Jan 10, 2013

This is perplexing for sure. I used the FMP Training Series file 13a_bonzai.fm12 exercise file to create the 2 scripts that will scan a barcode then return the results in a dialog.


Very simple. One script is named Show_Scan_Result and has just one step "Show Custom Dialog" with a message of "Barcode" & $result



The second one, called OpenPic2Shop, is supposed to do the heavy lifting. It uses a single script step Open URL with parameters "pic2shop://scan?callback=fmp" & GetAsURLEncoded ("://$/" & Get (FileName) & "?script=Show_Scan_Result&$result=EAN")


I then reference this script from a button.

These work perfectly and I get the UPC code returned to me as Dialog message. I then added a Global field in the Bonzai file and replaced the Dialog with inserting the results into the global field. That works on both the iPad and the iPhone.


But when I copy and paste these 2 scripts into another FMP 12 solution and run the Open script it launchs pic2shop but doesn't really do anything. It doesn't open the scanner screen so you can actually scan a barcode or it opens the scanner screen but it's blank and doesn't appear to activate the camera. It never returns to the FM Go. I then open the Bonzai file on the iPad and test it and it works.


I originally had spaces in the names of the solution and thought maybe the spaces were messing up the Get(fileName) in the encoding. I replaced them with underscores and same result. I thought maybe copy and pasting might messup a script somehow. I rewrote the script making sure they match. No luck.


Baffling for sure.


Dan Doughtie