Printer.GetJobsAsJSON
---------------------

Queries print jobs and returns JSON Array.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Printer](component_Printer.md) | [16.3](newinversion163.md) | ✅ Yes | ✅ Yes | ❌ No | ❌ No | ❌ No |

MBS( "Printer.GetJobsAsJSON" { ; Name; OnlyMyJobs; whichJobs } ) 

**MBS**( **"Printer.GetJobsAsJSON";** /\* Queries print jobs and returns JSON Array. \*/  
**$Name**; /\* Optional; Name of the printer queue to query.   
If no name or empty string is specified, we get all queues.  
  
On Windows we default to the default printer if name is empty.e.g. "Brother\_DCP\_8085DN" \*/   
**$OnlyMyJobs**; /\* Optional; Pass either "my" for your users jobs or "all" for all jobs.e.g. "all" \*/   
**$whichJobs**) /\* Optional; Pass "active" to get only active jobs, "all" for all jobs or "complete" for completed jobs.e.g. "complete" \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| Name | Name of the printer queue to query.    If no name or empty string is specified, we get all queues.      On Windows we default to the default printer if name is empty. | "Brother\_DCP\_8085DN" | Optional |
| OnlyMyJobs | Pass either "my" for your users jobs or "all" for all jobs. | "all" | Optional |
| whichJobs | Pass "active" to get only active jobs, "all" for all jobs or "complete" for completed jobs. | "complete" | Optional |

### Result

Returns JSON array or error.

### Description

Queries print jobs and returns JSON Array.  
We implemented this for Windows and then added a similar implementation for macOS.  
| Field | Value | Note |
|---|---|---|
| JobId | A job identifier. |  |
| PrinterName | The name of the printer for which the job is spooled. |  |
| MachineName | The name of the machine that created the print job. | Windows only |
| UserName | The name of the user that owns the print job. |  |
| Document | The name of the print job (for example, "MS-WORD: Review.doc"). |  |
| DataType | The type of data used to record the print job | Windows only |
| Formate | The spooling type. | MacOS only |
| Status | The job status. The value of this member can be zero or a combination of one or more of the flag values. A value of zero indicates that the print queue was paused after the document finished spooling. | different |
| Priority | The job priority. This member can be one of the following values or in the range between 1 through 99. | different |
| Position | The job's position in the print queue. | Windows only |
| TotalPages | The total number of pages that the document contains. This value may be zero if the print job does not contain page delimiting information. | Windows only |
| PagesPrinted | The number of pages that have printed. This value may be zero if the print job does not contain page delimiting information. | Windows only |
| CreationTime | The timestamp that this document was spooled. |  |
| ProcessingTime | The timestamp that this document was processed. | macOS only |
| CompletedTime | The timestamp that this document was completed. | macOS only |

  
States on macOS are Pending, Held, Processing, Stopped, Cancelled, Aborted or Completed.  
States on Windows are a combination of Paused, Error, Deleting, Spooling, Printing, Offline, Paperout, Printed, Deleted, Blocked device, User Intervention, Restart, Complete, Retained and Rendering locally.  
### Examples

Query printer jobs on macOS:

 MBS ( "Printer.GetJobsAsJSON" )  
<small>  
Example result:   
\[ { "JobId" : 7412 , "PrinterName" : "Laserdrucker" , "Format" : "application/pdf" , "Document" : "Untitled" , "UserName" : "cs" , "Status" : 5 , "State" : "Processing" , "Priority" : 50 , "Size" : 7 , "CompletedTime" : "01.01.1970 01:00" , "CreationTime" : "18.05.2026 12:38:31" , "ProcessingTime" : "18.05.2026 12:38:31" } \] </small>Query printer jobs on Windows:

 MBS ( "Printer.GetJobsAsJSON"; "Laserdrucker")  
<small>  
Example result:   
\[ { "JobId" : 2 , "PrinterName" : "Laserdrucker" , "MachineName" : "\\\\\\\\TESTSERVER" , "Document" : "Test" , "UserName" : "cs" , "Status" : 8209 , "State" : "Paused, Printing, Retained" , "TotalPages" : 0 , "PagesPrinted" : 1 , "Priority" : 1 , "Position" : 1 , "CreationTime" : "18.05.2026 13:19:35,022" } \] </small>Get all my jobs:

 MBS ( "Printer.GetJobsAsJSON"; ""; "my"; "all" )  
### See also

- [CUPS.GetJobsAsJSON](CUPSGetJobsAsJSON.md)

### Release notes

- **Version 16.3**
    - Added Printer.CancelJob and Printer.GetJobsAsJSON functions.

### Blog Entries

- [MBS FileMaker Plugin, version 16.3pr1](https://www.mbsplugins.de/archive/2026-06-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th May 2026 , last changed 18th May 2026

  
[Printer.GetDefaultPrinter](PrinterGetDefaultPrinter.md) - [Printer.PaperFormats](PrinterPaperFormats.md)

[HTML Version](PrinterGetJobsAsJSON.shtml)