I have a LiveCode app standalone that needs to know if there is a job waiting in the MacOS print queue before printing. If app user 1 prints the 2 page report and just one page prints (out of paper) then user 2 comes along and prints the report, the first page out is user 1's report and this is causing mixups. I would like to check the MacOS print queue and prevent printing if there is a job already waiting.
It's not something I've ever needed to do, but I suspect that this capability is not included in LiveCode natively. Instead your best bet will probably be to use LiveCode's
shell()function to run a unix terminal command. For instance,lpstatis a command line utility that allows you to query various things about printers connected to your Mac. The following command, run in the MacOS terminal, shows which printers are available and their current status.In LiveCode you use the
shell()function to call this command line utility, like so:To find out more about lpstat, open the Terminal and look up the man page:
Lots of options for that utility will appear. There should be one that gives you the information you need.