PaperCut Script Troubleshooting

Using a PaperCut Script using advanced scripting brings a whole new level to the control you have over a print job. That power can also bring with it a few technical issues if the code for the script is not perfect.

We are happy to troubleshoot script problems and below is a sample of our thoughts during the process.

We were sent a script that was not working as expected, you can see this script below.

Puting Things Right

Our first step is to always add the script to our own test installs of PaperCut and see what happens. In this instance, the script worked fine for us, which is a bit odd the customer was getting a message about an error displayed in PaperCut. The error in question was:

To break this down, we can see the message is informing us that on line 27 (printer-script#27) there is a problem with actions.client.promptForChoice, If you look at the parameters being used we have a string, an object and something that is undefined.

When we look at the line in the code we can see this:

So we know the string is the “Are you sure you want to print in colour?” and the Object is the options variable. This suggests the problem is with the dialogOptions, If we look at the dialogOptions variable in the script above, it all looks good, but for some reason, it is not being set. If we look at the line above it:

Everything under this, in theory, should only run if the job is in colour. As a test, we sent another print job but this time selected black and white, and that was when we managed to reproduce the error.
There is a bit of a trick when it comes to if statements if you don’t surround everything with { } it will only apply to the one line under it which in this case is the line that sets the dialogOptions.

To fix this, we suggested putting an { on line 22 and add another } on line 47. Luckily this didn’t cause any actual problems for what they are using the script for as only B/W jobs would trigger the error but it is something to keep an eye on in the future.

While PaperCut comes with dozens of pre-written script recipes, we also provide a script creation service to our channel. If you have a requirement or have questions? Simply get in touch with your Account Manager.

Get in touch today |




Latest News from Jonathan Bennetts

PaperCut and Access Management

Access Management and Identity as a Service (IDaaS) solutions for PaperCut...

Written by: Jonathan Bennetts


PaperCut ends client support for 32-bit operating syst...

A long time ago, in a country far far away... PaperCut announced they were...

Written by: Jonathan Bennetts



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
Back to Top ↑