AnsweredAssumed Answered

Pharos Scripting Help Needed

Question asked by Cade Webb on Aug 5, 2015
Latest reply on Aug 20, 2015 by Daniel Johns

I am working with the PrintEndJobNotify script to let students know where they are printing to.

 

Right now we display the print queues which are named (for exampple) Library-Printer1-PS or Library-Printer1-PCL or Library-Printer1-PCL-Wireless

 

I would like to modify the script to only show the user friendly part of the queue.  I am trying to remove everything after the Printer1 (the -PCL, -PS, -Wireless, etc).

 

We do not have more than 6 printers in one room so I I am thinking about

 

In VBS I tried something like wscript.echo left ("Library-Printer1-PCL-HeldQ",InStr("BSS316-Printer1-PCL-HeldQ", "-")+8) which worked great.

 

With Pharos:

 

initialize a as string

set a to the queue name

initialize b as int

set b to be the index of the “-“

call Left and pass the queue and the variable b

 

new a                       = PlugIn.Queue;

new b                       = Find(a,"-") + 8;

new c                       = Left(a,b);

 

new sMessageSuccess         = "Print job '" +

                                PlugIn.JobName +

                                "' printed on printer '" +

                                c +

                                "'.";

 

Pharos does not like the Find or Left functions even though they are listed in the documentation.  Any Pharos scripting guru's out there that could lead me in the right direction?

Outcomes