<h2 style="line-height: 1.5em; text-align: left;">PaperCut print script of the month - how to track virtual queues</h2>
<h3 style="line-height: 1.5em; text-align: left;">So this month our trip into the world of PaperCut Advanced Scripting (Print Scripting) comes off the back of a few calls from customers who would like to know how many jobs are being sent through their greyscale follow me queue.</h3>
If this is something, you are trying to do go and grab an espresso as this won't take long, and we can get started.
The idea here is we need to increase a value that can be viewable and reset from the admin interface as required. We would only want to count jobs that have been printed, and this is where the method below will come in.
<pre class="">actions.utils.onCompletionIncrementNumberProperty(propName, value[, options])</pre>
&nbsp;

The method will increase a global number by whatever value we tell it, The propName is going to be what we call this count, and we can use it to find the property later. This method is also only run once the script has finished and the job has been printed out so you won't be counting any jobs that are currently pending release.

In our test environment, the queue is called "Green Queue" so we are going to call the <em>property green-queue.</em> Once this bit has been worked out, we will need to work out what we want to increase the value by. We want to know the number of pages that were printed out so we can use <em>inputs.job.totalSheets.</em>

Now all that is left is to put this together and give us the one line that we need.
<pre class="">actions.utils.onCompletionIncrementNumberProperty('green-queue', inputs.job.totalSheets);</pre>
&nbsp;

To see the result of this, you can go to <em>Options &gt; Config Editor</em> and search for your property name, and you will be able to see how many pages have been printed out and reset the value if you want.

Of course, if you wanted to display the value in a pop-up message you could use the method below and remember to replace propName with whatever you used to set the value with.
<pre class="">inputs.utils.getNumberProperty(propName)</pre>
&nbsp;
<h3 style="line-height: 1.5em; text-align: left;">That is it for this month and as always the complete print script to track virtual queues is available below. If you have your own requirements for a print script and you don’t have the time or in-house experience to make it you can find out how we can help you by sending an email to our sales team at <a href="mailto:sales@selectec.com">sales@selectec.com</a></h3>
<strong>You might also be interested in:</strong>
<p class="content-title"><a href="https://staging.selectec.com/script-of-the-month-4-colour-only-extensions/">PaperCut Print Script of the Month #4</a> - Only allow colour printing from certain applications</p>
&nbsp;
<pre class="">/*
 * Track sheets printed on virtual queue
 *
 * Read more at https://staging.selectec.com/script-of-the-month-7-count-virtual-queue-sheets/
 */
function printJobHook(inputs, actions) {
 
 if (!inputs.job.isAnalysisComplete) {
 // No job details yet so return.
 return;
 }
 
 // Show current sheets
 actions.client.promptOK('So far "' + inputs.utils.getNumberProperty('green-queue') + '" pages have been printed using this queue');
 
 // Increment green-queue by total sheets in job
 actions.utils.onCompletionIncrementNumberProperty('green-queue', inputs.job.totalSheets)
 }</pre>