@PTRJOBS — Returns the number of jobs queued for the specified printer.

Syntax:
%@PTRJOBS[printername]

printername: if omitted, the user’s default printer

The function will return ??? on any error.

echo %@ptrjobs["LaserJet in Office"]