CUPS.GetPrintersAsJSON
----------------------

Queries list of printers as JSON.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [CUPS](component_CUPS.md) | [10.5](newinversion105.md) | ✅ Yes | ❌ No | ❌ No | ✅ Yes, on macOS | ❌ No |

MBS( "CUPS.GetPrintersAsJSON" ) ### Parameters

none

### Result

Returns JSON array or error.

### Description

Queries list of printers as JSON.  
Includes array with options list.  
JSON objects include name, instance, isDefault, optionCount and options as sub array with name and value.  
### Examples

Query printers:

 MBS ( "CUPS.GetPrintersAsJSON" )  
<small>  
Example result:   
\[ { "name" : "Brother\_DCP\_8085DN" , "instance" : null, "isDefault" : false, "optionCount" : 25 , "options" : \[ { "name" : "copies" , "value" : "1" }, { "name" : "device-uri" , "value" : "dnssd://Brother%20DCP-8085DN.\_pdl-datastream.\_tcp.local./?bidi" }, { "name" : "finishings" , "value" : "3" }, { "name" : "job-cancel-after" , "value" : "10800" }, { "name" : "job-hold-until" , "value" : "no-hold" }, { "name" : "job-priority" , "value" : "50" }, { "name" : "job-sheets" , "value" : "none,none" }, { "name" : "marker-change-time" , "value" : "1514723504" }, { "name" : "marker-colors" , "value" : "#000000,none" }, { "name" : "marker-levels" , "value" : "-3,0" }, { "name" : "marker-names" , "value" : "Black,Drum" }, { "name" : "marker-types" , "value" : "toner,drum" }, { "name" : "number-up" , "value" : "1" }, { "name" : "printer-commands" , "value" : "ReportLevels,PrintSelfTestPage,PJLBidirectional,PJLWrite,PJLRead" }, { "name" : "printer-info" , "value" : "Brother DCP-8085DN" }, { "name" : "printer-is-accepting-jobs" , "value" : "true" }, { "name" : "printer-is-shared" , "value" : "false" }, { "name" : "printer-is-temporary" , "value" : "false" }, { "name" : "printer-location" , "value" : "" }, { "name" : "printer-make-and-model" , "value" : "Brother DCP-8085DN CUPS" }, { "name" : "printer-state" , "value" : "5" }, { "name" : "printer-state-change-time" , "value" : "1586357640" }, { "name" : "printer-state-reasons" , "value" : "paused,com.brother.tray1-jam-warning,com.brother.duplex-jam-warning,com.brother.inside-hot-report,com.brother.drum-empty-report,cover-open-warning,media-jam-warning" }, { "name" : "printer-type" , "value" : "77639764" }, { "name" : "printer-uri-supported" , "value" : "ipp://localhost/printers/Brother\_DCP\_8085DN" } \] }, { "name" : "EPSON\_ET\_7700\_Series" , "instance" : null, "isDefault" : true, "optionCount" : 27 , "options" : \[ { "name" : "copies" , "value" : "1" }, { "name" : "device-uri" , "value" : "dnssd://EPSON%20ET-7700%20Series.\_ipps.\_tcp.local./?uuid=cfe91100-67c4-11e4-a45f-fee0271152ce" }, { "name" : "finishings" , "value" : "3" }, { "name" : "job-cancel-after" , "value" : "10800" }, { "name" : "job-hold-until" , "value" : "no-hold" }, { "name" : "job-priority" , "value" : "50" }, { "name" : "job-sheets" , "value" : "none,none" }, { "name" : "marker-change-time" , "value" : "1601626536" }, { "name" : "marker-colors" , "value" : "#000000,#00FFFF,#FF00FF,#FFFF00,#000000" }, { "name" : "marker-high-levels" , "value" : "100,100,100,100,100" }, { "name" : "marker-levels" , "value" : "97,97,97,97,97" }, { "name" : "marker-low-levels" , "value" : "15,15,15,15,15" }, { "name" : "marker-names" , "value" : "Photo\\\\ Black\\\\ ink,Cyan\\\\ ink,Magenta\\\\ ink,Yellow\\\\ ink,Black\\\\ ink" }, { "name" : "marker-types" , "value" : "ink,ink,ink,ink,ink" }, { "name" : "number-up" , "value" : "1" }, { "name" : "printer-commands" , "value" : "none" }, { "name" : "printer-info" , "value" : "EPSON ET-7700 Series" }, { "name" : "printer-is-accepting-jobs" , "value" : "true" }, { "name" : "printer-is-shared" , "value" : "false" }, { "name" : "printer-is-temporary" , "value" : "false" }, { "name" : "printer-location" , "value" : "" }, { "name" : "printer-make-and-model" , "value" : "EPSON ET-7700 Series-AirPrint" }, { "name" : "printer-state" , "value" : "3" }, { "name" : "printer-state-change-time" , "value" : "1601891140" }, { "name" : "printer-state-reasons" , "value" : "none" }, { "name" : "printer-type" , "value" : "69242972" }, { "name" : "printer-uri-supported" , "value" : "ipp://localhost/printers/EPSON\_ET\_7700\_Series" } \] } \] </small>### See also

- [CUPS.GetPrinterCount](CUPSGetPrinterCount.md)
- [CUPS.GetPrinterDefault](CUPSGetPrinterDefault.md)
- [CUPS.GetPrinterName](CUPSGetPrinterName.md)

### Release notes

- **Version 10.5**
    - Added [CUPS.GetPrintersAsJSON](https://www.mbsplugins.eu/CUPSGetPrintersAsJSON.shtml) and [CUPS.GetJobsAsJSON](https://www.mbsplugins.eu/CUPSGetJobsAsJSON.shtml) functions.

### Blog Entries

- [New in MBS FileMaker Plugin 10.5](https://www.mbsplugins.de/archive/2020-11-23/New_in_MBS_FileMaker_Plugin_10/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 10.5pr2](https://www.mbsplugins.de/archive/2020-10-05/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 6/2020, Seite 26](https://filemaker-magazin.de/neuigkeit/4118-Appetithappen-FMM_202006)

This function checks for a license.

Created 4th October 2020 , last changed 5th October 2020

  
[CUPS.GetPrinterName](CUPSGetPrinterName.md) - [CUPS.LastErrorCode](CUPSLastErrorCode.md)

[HTML Version](CUPSGetPrintersAsJSON.shtml)