Repeated Print Script Pop-ups

KB Home   |   Repeated Print Script Pop-ups

Main.RepeatedPrintScriptPopUps History

Hide minor edits - Show changes to output

November 16, 2018, at 07:05 AM by Aaron Pouliot - Added category - Print Scripting
Changed line 17 from:
''Categories:'' [[Category.Scripting|+]]
to:
''Categories:'' [[Category.PrintScripting|+]]
October 25, 2017, at 07:04 AM by jamesv - fixed a few typos
Changed lines 4-5 from:
This can occur if the print script requires user action for the job to be printed. '''The printjobhook runs multiple times during the hold release process.''' When prompting a dialogue from the printjobhook to users (e.g. prompOK) and the text of the pop up may change after one iteration of the printjobhook, such as using an inconsistent variable or new timestamp, a pop-up can repeat. The default method of identifying an already invoked pop up is by it’s contents. If these change then the script will start up another pop-up. This is by design as some scripts require multiple pop ups with different questions or information.
to:
This can occur if the print script requires user action for the job to be printed. '''The printjobhook runs multiple times during the hold release process.''' When prompting a dialogue from the printjobhook to users (e.g. prompOK) and the text of the pop-up may change after one iteration of the printjobhook, such as using an inconsistent variable or new timestamp, a pop-up can repeat. The default method of identifying an already invoked pop-up is by it’s contents. If these change then the script will start up another pop-up. This is by design as some scripts require multiple pop-ups with different questions or information.
Changed lines 14-15 from:
@@actions.client.promptOK(“This page size is not allowed., dialogOptions);@@
to:
@@actions.client.promptOK("This page size is not allowed.", dialogOptions);@@
Changed line 19 from:
[-Keywords: scripting loop repeated pop up prompts options print papercut-]
to:
[-Keywords: scripting loop repeated pop-up pop up prompts options print papercut-]
October 25, 2017, at 07:01 AM by jamesv - Created new KB about repeated print scirpting
Added lines 1-19:
(:title Repeated Print Script Pop-ups:)

!!From time to time sys admins will reach out to us about a strange quirk of print scripting, where the same pop-up will appear multiple times causing confusion for the end user.
This can occur if the print script requires user action for the job to be printed. '''The printjobhook runs multiple times during the hold release process.''' When prompting a dialogue from the printjobhook to users (e.g. prompOK) and the text of the pop up may change after one iteration of the printjobhook, such as using an inconsistent variable or new timestamp, a pop-up can repeat. The default method of identifying an already invoked pop up is by it’s contents. If these change then the script will start up another pop-up. This is by design as some scripts require multiple pop ups with different questions or information.

To workaround this, you will need to add an identifier (questionId) to the pop-up so that PaperCut will know that either the user has responded or that the pop-up already exists and is waiting for a response. To do this use Client Prompt Standard Options.
Information about Client Prompt Standard Options and questionID here:
https://www.papercut.com/products/ng/manual/common/topics/script-print-api.html#script-print-actions-client-stdopts

Example usage:

@@var dialogOptions = {"questionID":"incorrectPageSize"};@@

@@actions.client.promptOK(“This page size is not allowed.”, dialogOptions);@@

----
''Categories:'' [[Category.Scripting|+]]
----
[-Keywords: scripting loop repeated pop up prompts options print papercut-]

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