2 Replies Latest reply on Jan 12, 2009 5:01 PM by DJM

    Question on Printing Using a Script



      Question on Printing Using a Script


      Hi FMP Community,


      Environment Info

      FMP 9.0 v3

      Mac OSX 10.5.6

      Two  Printers on the Mac: a Canon MP 970 (default) and a Brother QL-570 label printer  


      I am new to scripting and I have been trying to resolve an issue printing a label.

      Here is what I want to accomplish; while in a layout of current record I want to print a single label (Layout) with a subset of fields using a button that executes a script.  Ideally I want to do this with no dialogues so all I do is click the button and a label is printed. The issue I have is that even though have specified a format for specific printer (Brother QL-570)  and label size in the Print Setup step and specified the same printer in the Print step the script always defaults to the "default" printer (Canon) not the one I specified in the script setup.


      I have tried the script with and without dialogues and I have also set the printer attributes to "Standard" per a suggestion in another posting. No matter what I do the Print script step will not restore to the printer I want.  Any suggestions?


      Here is the simple script:


      Goto Related Record [.... etc.

      #Next set the printer and page attributes for the  Brother QL-570

      Print Setup [Restore, No dialog]

      Enter Preview Mode []

      #In preview mode the single label is displayed properly 

      #In the next step I specify the Brother QL-570 printer and leave the Presets as standard 

      Print [Restore] 

      Pause/Resume Script [Indefinitely]


      As mentioned  when the script is run the Brother QL-570 has not been selected and I need to do it manually in the print dialogue.  If I set the Print step to perform without dialog the label will be printed on the system default Canon printer.


       Any suggestions here??? Am I mssing something?










        • 1. Re: Question on Printing Using a Script

          FileMaker Pro 10 has a new feature that you need - 


          Print script step — Improved to let you save a specified target printer with a name of any length when a script runs. 


          Select Specify print options or click Specify to specify an output destination. When the script executes, the output from this script step is sent to the printer or fax you specified. 

          • 2. Re: Question on Printing Using a Script

            Hi David,


            Thanks for posting your comments.  Where I am perplexed  is it seems that in  FMP9 the RESTORE paramiter does not perform as one might expect with the PRINT script step.  Curious do you know if this is a bug?  


            I did find a work around in the knowledge base that I will post for others.


            refer to TechInfo answer 6185 


          • Within a test database, open ScriptMaker.
          • Click 'New...' to create a new script, name the script "Change Printer"
          • Select "Miscellaneous" from the 'View' drop down menu. Double click on the 'Perform AppleScript' script step.
          • Click on the 'Specify' button and if not already selected, choose the 'Native AppleScript' radio button.
          • Type the following AppleScript: (replace <PRINTER NAME> with the name of the desired printer name) 

            tell application "Printer Setup Utility" 
                Set the current printer to printer "<PRINTER NAME>" 
            end tell 

          • Click OK and OK again to exit ScriptMaker. This script will now change the default printer for the Operating System.