2 Replies Latest reply on Feb 3, 2010 1:13 PM by philmodjunk

    Script Step - Printer Setup: a question



      Script Step - Printer Setup: a question


      I want a particular script to produce a report in Landscape mode. I have the following steps in there:


      1. Print Setup (without dialog) that sets it to Landscape mode

      2. Preview Mode that allows the user to preview various pages

      3. Print with dialog


      In any new session, when the the user first runs the script that has those three steps, aren't they always confronted with the printer selection I was forced to set when creating step 1 above? 


      That is, suppose I have HP3030 as my default printer here when I create that script, and I allow that to be the selection I see when creating step 1. Now my client runs it on their computer, where they have an Epson1100 as their default printer. They change the printer selection in step 3 and everything works fine for each printing that session. But aren't they confronted with having to change it again tomorrow, when they start up my solution and run that script again?

        • 1. Re: Script Step - Printer Setup: a question

          You could make it run once per session.


          What you would do is make a global variables -




          When the script runs for the first time, $$selectedPrinter will = "" (nothing).


          So immediately after the user sets the printer, set $$selectedPrinter to a function: Get(PrinterName).


          Then, you can change your script to this:


          If($$selectedPrinter <> Get(PrinterName) or $$selectedPrinter = "")

            Print Setup []

            Set Variable $$printerSet ; Get(PrinterName)

          Enter Preview Mode 




          Then, it would only run print setup dialog if the user changed the printer or the printer hadn't been set yet. 


          Also, you could save it to a table of printers and call different set printer steps based on user. I've had to do such a thing. 

          • 2. Re: Script Step - Printer Setup: a question

            I'd test this and see, but print setup doesn't actually select the printer, the print step does. If this is a single user file, the last selected printer is, I think, the printer they'll see in the dialog.


            I often do a variation of your script that leaves out the print step.


            Instead, I just enter preview mode and pause. Continuing the script returns them to Browse mode and possibly a different layout. If they want to print what they see in preview, they can simiply select print from the File menu. This approach sides steps a number of printer selection issues but often requires that you educate your users about the differences between "current record" and "records being browsed".