Using Common Scripts

KB Home   |   Using Common Scripts

Main.UsingCommonScripts History

Hide minor edits - Show changes to output

November 16, 2018, at 07:05 AM by Aaron Pouliot - Added category - Print Scripting
Changed line 29 from:
''Categories:'' [[Category.Scripting|+]]
to:
''Categories:'' [[Category.PrintScripting|+]]
September 19, 2017, at 03:03 AM by JamesV - added how to training video
Added lines 24-26:


(:youtube 14tmd5ir4Fs:)
Changed lines 5-6 from:
Writing a common script for multiple queues is quite a simple process. It will involve creating a single JavaScript file on your PaperCut Application Scoerver with as many functions within that file as you would like to create. These functions are created much like as they would in the Scripting window for a single printer.
to:
Writing a common script for multiple queues is quite a simple process. It will involve creating a single JavaScript file on your PaperCut Application Server with as many functions within that file as you would like to create. These functions are created much like as they would in the Scripting window for a single printer.
March 31, 2014, at 04:59 AM by Jason - Remove references to printer-script.common and replace with print-script-common.js
Changed lines 5-6 from:
Writing a common script for multiple queues is quite a simple process. It will involve creating a single JavaScript file on your PaperCut Application Server with as many functions within that file as you would like to create. These functions are created much like as they would in the Scripting window for a single printer.
to:
Writing a common script for multiple queues is quite a simple process. It will involve creating a single JavaScript file on your PaperCut Application Scoerver with as many functions within that file as you would like to create. These functions are created much like as they would in the Scripting window for a single printer.
Changed lines 11-12 from:
Each script you will be creating is going to be added to the @@print-script-common.js@@ file. When creating your common scripts, it is always best to first create the script on a physical printer queue, testing all variables of the script and ensuring it is working as intended. Once your script is working and you are happy with how it's running, you can edit the @@printer-script-common.js@@ file in Notepad++ and add the function to the end of the file.
to:
Each script you will be creating is going to be added to the @@print-script-common.js@@ file. When creating your common scripts, it is always best to first create the script on a physical printer queue, testing all variables of the script and ensuring it is working as intended. Once your script is working and you are happy with how it's running, you can edit the @@print-script-common.js@@ file in Notepad++ and add the function to the end of the file.
Changed lines 17-18 from:
To call this function in the printer script, you can see in the below picture that I added a line below my function, which will check the @@printer-script-common.js@@ script for any functions named this. Please note that any functions in your print script '''can not''' be named the same as a function you've already named in the @@printer-script-common.js@@ file.
to:
To call this function in the printer script, you can see in the below picture that I added a line below my function, which will check the @@print-script-common.js@@ script for any functions named this. Please note that any functions in your print script '''can not''' be named the same as a function you've already named in the @@print-script-common.js@@ file.
June 20, 2013, at 12:45 AM by Jason - keywords
Changed line 28 from:
[-Keywords: master include-]
to:
[-Keywords: master include, global include, global script-]
Changed lines 3-6 from:
Large organizations with advanced print scripting requirements may need to share common scripts between different print queues. Writing a common script allows reuse of JavaScript code and functions without needing to copy script code to all printers, and also makes it much easier for administrators to change and edit the scripts being used on multiple queues.

To write a common script for use in multiple queues is quite a simple process, it involves creating a single JavaScript file on your PaperCut Application Server with as many functions within that file as you would like to create. These functions are created much like as they would in the Scripting window for a single printer.
to:
Large organizations with advanced print scripting requirements may need to share common scripts between different printer queues. Writing a common script allows reuse of JavaScript code and functions without needing to copy script code to all printers, and also makes it much easier for administrators to change and edit the scripts being used on multiple queues.

Writing a common script for multiple queues is quite a simple process. It will involve creating a single JavaScript file on your PaperCut Application Server with as many functions within that file as you would like to create. These functions are created much like as they would in the Scripting window for a single printer.
Changed lines 13-14 from:
There is one change that will need to be made for each function you are creating. When adding it to your common print script file, you will need to change the function name to something unique and memorable. Below is a function created for Duplex and Grayscale to be set for a certain group, you can see I've named this function something easy to remember.
to:
There is one change that will need to be made for each function you are creating. When adding it to your common print script file, you will need to change the function name to something unique and memorable. Below is a function created for duplex and grayscale to be set for a certain group, you can see I've named this function something easy to remember.
Added lines 7-8:
!!Creating your common print script
Changed lines 21-33 from:


--IN PROGRESS--


!!Subheading





TODO link your page here: https://www
.papercut.com/kb/Main/Miscellaneous
to:
It is best to test your common print script is working before deploying out to a live printer queue. 

Please note that if there is a functionality error in your @@print-script-common
.js@@, a warning will be shown on '''all''' print script windows, including scripts not calling the common script file. This is to ensure you see any errors for these common print scripts and can remedy the warning.
Changed line 26 from:
''Categories:'' [[Category.TODOFirstCategory|+]], [[Category.TODOSecondCategoryIfNeeded|+]]
to:
''Categories:'' [[Category.Scripting|+]]
Changed line 28 from:
[-Keywords: TODO keywords here if needed-]
to:
[-Keywords: master include-]
Changed lines 15-16 from:
To call this function in the printer script, you can see in the below picture that I added a line below my function, which will check the @@printer-script-common.js@@ script for any functions named this. Please note that any functions in your print script '''can not''' be named the same as a function already given in the @@printer-script-common.js@@ file.
to:
To call this function in the printer script, you can see in the below picture that I added a line below my function, which will check the @@printer-script-common.js@@ script for any functions named this. Please note that any functions in your print script '''can not''' be named the same as a function you've already named in the @@printer-script-common.js@@ file.
Changed lines 11-12 from:
There is one change that will need to be made for each function you are creating. When adding it to your common print script file, you will need to change the function name to something unique and memorable. Below is a function created for Duplex and Grayscale to be set to a certain group, you can see I've named this function something easy to remember.
to:
There is one change that will need to be made for each function you are creating. When adding it to your common print script file, you will need to change the function name to something unique and memorable. Below is a function created for Duplex and Grayscale to be set for a certain group, you can see I've named this function something easy to remember.
Changed lines 15-16 from:
To call this function in the printer script, you can simply add the below line (shown in line 2) to any print script. This will call the function at the point you've added in the script.
to:
To call this function in the printer script, you can see in the below picture that I added a line below my function, which will check the @@printer-script-common.js@@ script for any functions named this. Please note that any functions in your print script '''can not''' be named the same as a function already given in the @@printer-script-common.js@@ file.
Added lines 19-20:

Changed lines 11-12 from:
There is one change that will need to be made for each function you are creating. When adding it to your common print script file, you will need to change the function name to something unique and memorable. Below is a function created for
to:
There is one change that will need to be made for each function you are creating. When adding it to your common print script file, you will need to change the function name to something unique and memorable. Below is a function created for Duplex and Grayscale to be set to a certain group, you can see I've named this function something easy to remember.
Added lines 15-18:
To call this function in the printer script, you can simply add the below line (shown in line 2) to any print script. This will call the function at the point you've added in the script.

%center%Attach:Image2.png

Changed lines 13-14 from:
%center%Attach:Image1.png
to:
%center%Attach:Image21.png
Changed lines 13-14 from:
%center%Attach:Image001.png
to:
%center%Attach:Image1.png
Added lines 13-14:
%center%Attach:Image001.png
Changed lines 13-21 from:




1)



to:
--IN PROGRESS--

Changed lines 11-16 from:
Shown below is how




to:
There is one change that will need to be made for each function you are creating. When adding it to your common print script file, you will need to change the function name to something unique and memorable. Below is a function created for




Changed lines 9-10 from:
Each script you will be creating is going to be added to the @@print-script-common.js@@ file. When creating your common scripts, it is always best to first create the script on a physical printer queue, testing all variables of the script and ensuring it is working as intended. Once your script is working and you are happy with how it's running, you can edit the @printer-script-common.js@@ file in Notepad++ and add the function to the end of the file.
to:
Each script you will be creating is going to be added to the @@print-script-common.js@@ file. When creating your common scripts, it is always best to first create the script on a physical printer queue, testing all variables of the script and ensuring it is working as intended. Once your script is working and you are happy with how it's running, you can edit the @@printer-script-common.js@@ file in Notepad++ and add the function to the end of the file.
Deleted lines 6-7:
When creating these scripts, it is always best to first create the script on a physical printer queue, testing all variables of the script and ensuring it is working as intended. Once your script is working and ready to be added to to add to your common scripts.
Changed lines 9-10 from:
to:
Each script you will be creating is going to be added to the @@print-script-common.js@@ file. When creating your common scripts, it is always best to first create the script on a physical printer queue, testing all variables of the script and ensuring it is working as intended. Once your script is working and you are happy with how it's running, you can edit the @printer-script-common.js@@ file in Notepad++ and add the function to the end of the file.
Changed lines 15-17 from:
Outlined are the steps below to achieve this.

to:

Changed lines 19-22 from:
2) In this


to:


Changed lines 5-10 from:
To write a common script for use in multiple queues is quite a simple process, it involves creating a single JavaScript file on your PaperCut Application Server with as many functions within that file as you would like to create. These functions are created much like as they would in the Scripting window for a single printer, except for a change to one of the first lines in the script, which will be explained below.

When creating these scripts, it is always best to first create the script works on a physical printer queue, testing all variables of the script and ensuring it is working as intended
.


to:
To write a common script for use in multiple queues is quite a simple process, it involves creating a single JavaScript file on your PaperCut Application Server with as many functions within that file as you would like to create. These functions are created much like as they would in the Scripting window for a single printer.

When creating these scripts, it is always best to
first create the script on a physical printer queue, testing all variables of the script and ensuring it is working as intended. Once your script is working and ready to be added to to add to your common scripts.

To create your common script file, you will need to create a new file in Notepad++ or something similar, and save it with the name of @@print-script-common.js@@ to the @@[app-path]\server\custom@@ directory on your PaperCut Application Server.


Changed lines 19-20 from:
1) Create a new file in Notepad++ or something similar, and save it with the name of @@print-script-common.js@@ to the @@[app-path]\server\custom@@ directory on your PaperCut Application Server.
to:
1)
Changed lines 3-6 from:
Large organizations with advanced print scripting requirements may need to share common code between different print scripts. Writing a common script allows reuse of JavaScript code and functions without needing to copy script code to all printers.

To write a common script for use in multiple queues is quite a simple process, and involves creating a javascript file on your PaperCut Application Server.This file can hold any number of functions that can be called from any printer queue's Scripting tab. Outlined are the steps below to achieve this
.
to:
Large organizations with advanced print scripting requirements may need to share common scripts between different print queues. Writing a common script allows reuse of JavaScript code and functions without needing to copy script code to all printers, and also makes it much easier for administrators to change and edit the scripts being used on multiple queues.

To write a common script for use in multiple queues is quite a simple process, it involves creating a single JavaScript file on your PaperCut Application Server with as many functions within that file as you would like to create
. These functions are created much like as they would in the Scripting window for a single printer, except for a change to one of the first lines in the script, which will be explained below.

When creating these scripts, it is always best to first create the script works on a physical printer queue, testing all variables of the script and ensuring it is working as intended.



Shown below is how



Outlined are the steps below to achieve this.


Changed lines 20-23 from:
2)


to:
2) In this


Changed lines 7-8 from:
1) Create a file in Notepad++ or something similar, and save it with the name of @@print-script-common.js@@ to the @@[app-path]\server\custom@@ directory on your PaperCut Application Server.
to:
1) Create a new file in Notepad++ or something similar, and save it with the name of @@print-script-common.js@@ to the @@[app-path]\server\custom@@ directory on your PaperCut Application Server.
Added lines 1-24:
(:title Using Common Scripts:)

Large organizations with advanced print scripting requirements may need to share common code between different print scripts. Writing a common script allows reuse of JavaScript code and functions without needing to copy script code to all printers.

To write a common script for use in multiple queues is quite a simple process, and involves creating a javascript file on your PaperCut Application Server.This file can hold any number of functions that can be called from any printer queue's Scripting tab. Outlined are the steps below to achieve this.

1) Create a file in Notepad++ or something similar, and save it with the name of @@print-script-common.js@@ to the @@[app-path]\server\custom@@ directory on your PaperCut Application Server.

2)



!!Subheading





TODO link your page here: https://www.papercut.com/kb/Main/Miscellaneous

----
''Categories:'' [[Category.TODOFirstCategory|+]], [[Category.TODOSecondCategoryIfNeeded|+]]
----
[-Keywords: TODO keywords here if needed-]

Comments

Share your findings and experience with other PaperCut users. Feel free to add comments and suggestions about this Knowledge Base article. Please don't use this for support requests.

Article last modified on November 16, 2018, at 07:05 AM
Printable View   |   Article History   |   Edit Article