img

PaperCut Print Script of the Month #2 – Days until Christmas


PaperCut Print Script – Days until Christmas

 

It is almost that time of year again where we get some time off work and eat until we nearly explode and watch whatever James Bond film happens to be on the TV. This month we are going to create a PaperCut Print Script to tell the users how many days there are to go until the big day, so grab a cup of coffee or tea and let’s begin.

We begin our script this month by creating a new Date object this will make it easier to work with dates which are usually done by converting the date to a number and working from there, this is called Unix Time or POSIX / Epoch Time.

Next up is to set the date we want to use for our countdown and convert it to Unix Time using the Date.parse() method and also set a variable to today’s date that we will use later.

So now we need to do a little bit of math to work out what difference is between today and 25th December then convert it to a number that will actually mean something to a user and also round it to the nearest whole number.

All we need to do now is add in a few if statements to handle the three possible outcomes, then send the user a message that is relevant. We only have three possible cases to take into consideration here; Christmas has not yet happened, Christmas has happened and today is Christmas (We don’t recommend working on Christmas day unless something important is on fire).

That is it now you have a script you can use to let your users know how many days there are until Christmas, you could restrict this to certain groups of users or even use it to remind people of any events you have coming up.

As always the complete print script is below and 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 sales@selectec.com

PaperCut Print Script
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

Having dealt with Selectec for the past 8 years the service and support we get for PaperCut MF has been exceptional, support requests are met in a short timescale and dealing with the friendly and knowledgeable staff is always a pleasure

Phil Kelly Midshire Business Systems
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 ↑