img

PaperCut Print Script of the Month #13 Select Release Account


PaperCut print script of the Month

Like most days I was sat at work enjoying my coffee while listening to a random playlist on Spotify when my VOIP phone rings. It was one of our valued resellers who wanted us to throw some ideas at them to meet a client’s requirements. What he wanted to do was set up a way that delegated print release could be optional for the students, and the PaperCut Shared Accounts would still be charged. There was a catch with this one where the users doing the releasing would be teaching assistants who move between classes.

At first, it seemed like it could be almost impossible to do this and make it optional. After about 15 minutes we decided that a PaperCut print script might be able to handle this and not get in the way of the workflow too much. Take a couple of minutes to digest this scenario and go and get your coffee before we start working it out.

 

First, we need to work out what we want to do, and that is to present a list of users to any account in a group, and once selected let that user release the job.
Let’s start by creating an array that will store the users we will show in the popup and set the group that this will apply to.

All good so far, Now we know we will want to show a popup so we might as well set a couple of variables to hold the popup message and the title.

As we only want this window to appear for the student’s group we will want to check inputs.user.isInGroup() and if it isn’t the group we want we will need to leave the script.

To display our prompt we are going to use actions.client.promptForChoice(), It will accept a message and an Array of choices which will return the selected value when the user clicks on OK.

If we just used this, the popup would show the document information, and a generic title so let’s set some options like hiding the job details, showing our title and setting the default choice to none.

We now need to go back and update our actions.client.promptForChoice() method to include the options we want.

All that is left to do now is work out how we are going to enable the other user account to release the job. To achieve this we are going to change the user that owns the print job. Usually, this would cause a problem with reporting if you wanted to know which user was sending the job but luckily for this case, it doesn’t matter as the shared account will be billed.
So what is this magical method? actions.job.changeUser(), If you plan to use this make sure the users exist and if you intend to let the users manually type in the name make sure you check the input is not longer than 50 characters.

So back to the script, we will check that the response is not “none” then change the user that owns the job to whatever the value of the response happens to be.

That is it for this month and as always the complete PaperCut print script is below.

We can help you with print scripts! You can find out more about what we offer here. So, if you have your own requirements for a print script and you don’t have the time or in-house experience to make it then simply contact us.

Get in touch today | sales@selectec.com

Latest News from Jonathan Bennetts
img

Grant temporary access to printers using PaperCut

How do I grant temporary access to company printers?   One of our rese...

Written by: Jonathan Bennetts

More
img

Peppermint Technology PaperCut Integration

Peppermint technology PaperCut integrations Selectec were approached by our ...

Written by: Jonathan Bennetts

More

img

We have worked with Selectec for a number of years now and they are the perfect PaperCut partner for us. The support team is fantastic and knowledgeable and the sales staff are superb. With the high level of service we get from Selectec we have no reason to consider using anyone else.

Martin Croft Direct-tec Group Ltd
This website works best using cookies which are currently disabled. We use cookies to help with our site analytics to improve our services.
Back to Top ↑