1 Reply Latest reply on Jul 9, 2010 1:01 PM by philmodjunk

    Binding a particular printer to a button script

    schlichter11

      Title

      Binding a particular printer to a button script

      Post

      Is it possible to have a script attached to a button that prints to a particular printer?  For example, we have layouts that are made to print to a label printer and we have layouts that print to our letter head printer.  Can a script be created and added to the layout via a button that chooses the correct printer for that layout?  I see where I can choose one printer for Filemaker in general in preferences, but can't seem to change it within a script.  We have a problem with our staff accidentally printing labels to the letterhead printer and vice versa.  Thanks for your help. 

        • 1. Re: Binding a particular printer to a button script
          philmodjunk

          The basic script step you can use is Print [Restore] and you can select the printer you want when you add this step to a script you set up your button to run. Given that you may change printers in the future, you may want to set up separate print scripts for each printer:

          Make a single line script for each printer you use: Print [Restore] where you specify by name the printer you want and give the scripts descriptive names like "Print to Label Printer". Then, in any scripts where you want to include a print script, use Perform Script to run the desired print script. This way, if you change a printer in the future, you just update the single line print script and all your other scripts that print don't need to be updated.

          If you want a script to check the layout and use the printer appropriate for the current layout, you can write a script such as:

          If [ Get ( LayoutName ) = "Labels"
             Perform Script ["Print to Label Printer"]
          Else
             Perform Script ["Print to LetterHead"]
          End If