11 Replies Latest reply on Aug 25, 2009 2:38 PM by TSGal

    Script with Print[No Dialog] "remembers" wrong printer



      Script with Print[No Dialog] "remembers" wrong printer

      Description of the issue

      System Info:FMP 10v3 on Windows XP SP3. Two Printer Drivers:Epson SQ-2500 (For printing Invoices on NCR paper)--Default PrinterHP-OfficeJet Pro K850 Series One printer at a time is physcially connected to the computer. (This is my development "test bed" and I rarely have to use the epson driver). Test 1:I connect the dot matrix printer (Uses the Epson driver) and launch the database.I select File Print Setup and specify the Epson printer driver. (K850 printer shows when dialog first appears.)I perform the print script.Filemaker Attempts to print to the dot matrix printer but uses the K850 printer driver instead of the default printer. Result, naturally is gobbletygook. Test 2:I modify the script by clearing the No Dialog option on the print script step.I repeat steps 2 & 3 above.The dialog appears still showing the K850 driver as the selected printer.I select the Epson Driver, continue the script and get the correct output.Test 3:I close and reopen the database.When I select Print Setup from the file menu, I see the Epson driver already selected.I perform the script.The dialog appears specifying the K850 driver! What I'm trying to do:If this were the production copy of the database, I'd use the restore option to hardwire the script to the epson driver and also select it as the default printer. That combination works well for us. But I'm putting together a demo version of this database. I have no way of knowing what printer an interested potential customer will use when test driving it. I would like the demo file to always print using the default printer driver, without having the script stop and pop up a print dialog. The above tests suggest that might not be possible if the user happens to have one or more of the above drivers on their computer. :smileymad:   

        • 1. Re: Script with Print[No Dialog] "remembers" wrong printer



          Thank you for your post.


          A number of users want a "Default" printer option.  As it now stands, if you are trying to print to a printer that does not exist, then FileMaker will print to the default printer.


          For now, set your scripts to print to the Epson driver, and tell your clients that the demo is set up to print to an Epson SQ-2500.  If the clients do not have an Epson SQ2500 (or an Epson that uses that same driver), FileMaker will then print to their default printer.


          When you save a Print Setup or Print script step, the print driver is also saved.  That is why in Test 3, the print dialog continues to display the K850 driver.


          I encourage you to enter this suggestion into our Feature Suggestion web form at:




          I could easily copy your post and paste it into the web form, but there are additional questions asked that only you can answer. 



          FileMaker, Inc.

          • 2. Re: Script with Print[No Dialog] "remembers" wrong printer

            Thank you for you response. A variation of that message will probably work in this case.


            "When you save a Print Setup or Print script step, the print driver is also saved.  That is why in Test 3, the print dialog continues to display the K850 driver."

            I see I left out a key detail. The restore that I removed, stored the settings for the EPSON printer. 


            I expected one of the following four possibilities to control which print driver would be used when I ran the script without a saved print set up in the script:

            1) The most recently used print driver would be selected

            2) The printer selected manually via Print Setup would be selected.

            3) The default printer would be selected.

            4) The printer setting last saved in the script would be selected.


            In the case of test 4, the K850 is none of these. The Epson was the default, it was manually selected from print set up, it was the printer setting saved in the script and it was the last used to print.


            The only possible logic that I can see to why the K850 settings persisted in each case is that the K850 was the default printer at the time the file was originally converted from a 5.5 version file. If that's the case, we've got a significant bug here.

            • 3. Re: Script with Print[No Dialog] "remembers" wrong printer



              Thank you for the additional information.


              In test 4, I need a little more clarification.  Are you talking about the setting last saved when you ran the script?  Or, are you talking about the setting last saved when you modified the script step itself?  The difference is that whatever is stored with the script step (Manage Scripts) should continue to display each time; regardless of what you selected previously when the script is run.  For example, if you saved in Manage Scripts the K850 driver, then you execute the script manually, the K850 driver will display.  If you change this as the script is running to Epson, it will not save Epson to the script step.  The next time you execute the script, K850 will display again.  Does that make sense?


              Better yet.  Create two different scripts.  Name one script "Epson" and one script "HP".  For "Epson", enter one script step:


              Print [ Restore ]


              where you are specifying the Epson print driver.


              Do the same for "HP".


              Now, execute the "Epson" script.  You will see the "Epson" driver is selected.  You can cancel the script.  Do the same for "HP" script.


              Create a third script "Last Used".  The script step would be:


              Print [ ]


              If you execute this script, it will display the last printer used.  Select the Epson driver and print.  Run the script again, and the Epson driver is displayed.  Select the HP driver and print.  Run the script again, and the HP driver is displayed.


              Let me know what tests you are doing, and I'll try to duplicate it here.



              FileMaker, Inc. 

              • 4. Re: Script with Print[No Dialog] "remembers" wrong printer

                The saved "Epson" printer was saved within the script by using the specify button within the script editor. Once I cleared the Specify check box, the script began selecting the K850 printer even though it was, never specified in the script, not selected for printing manually prior to script execution nor selected manually during script execution.


                This is why I made started this bug report in the first place!


                I'll do some testing with separate, one line scripts for printing, just to see if there might be some corruption in the script itself.

                • 5. Re: Script with Print[No Dialog] "remembers" wrong printer

                  Additional Test:


                  Created a single line script: Print[]

                  Replaced Print step in original script with a Perform Script step to perform the above "print" script.


                  Here's what I observed:

                  Immediately after launching the file, I see the K850 printer appear in the print dialog opened by this new script.

                  If I select the epson driver and print once, each subsequent call to the print script shows the epson driver.

                  However, if I close and reopen the file, I once again get the non-default K850 driver appearing in the dialog and if I modify this new script to select the "no dialog option", it prints with the K850 driver.


                  Thus, I can get the scripts to print using the default printer driver, but only after I have already printed once to this printer. Closing and re-opening the file resets us back to the wrong driver.


                  It seems like filemaker is selecting a printer in this scenario according to some sort of logic (perhaps the HP K850 was installed first?) that ignores the Windows default printer setting. I suspect that if my potential customers have only one local printer driver installed, there will be no problem with the demo file. If they have more than one, I may get complaints/lose sales due to the script printing on an unexpected printer.

                  • 6. Re: Script with Print[No Dialog] "remembers" wrong printer

                    And another test:


                    I created two new, single record, single field database files.


                    I created a single line script in each: Print []


                    Just to rule out a long shot possibility, I created the one file while the Epson driver was selected as "default" and created the other file while the HP K850 drivers as selected as default.


                    Regardless of which printer driver is set as the default, both scripts select the K850 driver until a print action is performed that selects a different driver. UNLIKE my demo file, each file appears to retain whichever printer was last used in printing and defaults to that printer--even if I quit and restart Filemaker until I select a different printer.


                    I can also use File | Print Setup to select a printer and the script will now show whichever driver was thus selected. This also differs from the tests I've performed on my demo file.


                    Perhaps the demo file has latent corruption? Perhaps a file with defined accounts/passwords behaves differently? Perhaps there's some other significant difference between these files?


                    Looks like I have more testing to do to try to nail this down. :smileysad:

                    • 7. Re: Script with Print[No Dialog] "remembers" wrong printer
                         Problems like this are hard to nail down as Filemaker behaves differantly if the print steps are preformed with or without dialog. (Without will send it too your os's default printer. and the "stored" printer is only retained if you print with dialog and the printer is avalible.) I have taken to using OS level scripting to change Default printer on the computer and then preforming a PageSetup[no dialog] in the file in question in order to send print jobs to any specified printer without the need for user interaction.
                      • 8. Re: Script with Print[No Dialog] "remembers" wrong printer

                        The problem is that this is NOT what I am observing. I've been running the scripts with all three settings and comparing the results.


                        The Print[] and Print[no dialog] steps are not selecting the default printer consistently.


                        Print[no dialog] appears to select the same printer I see when I use Print[] and check to see which printer appears listed in the dialog.


                        Changing Print[no dialog, restore] to Print[no dialog] prints to a different, non-default printer than the original Print[no dialog, restore] step did.


                        Now I'm finding that my stripped down test files are behaving differently from my solution file which suggests several additional tests to explore these differences.

                        • 9. Re: Script with Print[No Dialog] "remembers" wrong printer

                          Each experiment seems to answer some questions, yet create new ones.


                          I took my demo file and recovered it. Filemaker reported that "no problems were found..."


                          I tested the recovered copy and found that its behavior differed from the original copy.


                          I can now manually use Print Setup to select a printer and Print[no dialog] now prints to the printer selected. This is predictable behavior I can use in my demo release as I can tell users that if they have more than one local printer, they can select the printer from Printer set up in the File Menu.


                          Just to be sure, I opened my original copy and repeated the same exact steps. In the original, unrecovered copy, any printer selection I make from File | Print Setup... is ignored and the script persists in printing to the HP K850 printer.


                          So latent file corruption seems to explain the unexpected print behavior, but now a recover operation appears to have fixed the file yet reports that "no problems were found..." :smileymad:

                          • 10. Re: Script with Print[No Dialog] "remembers" wrong printer

                            One more comment:


                            This is a demo version of the file that didn't get backed up in:


                            FMS 10 scheduled back up starts but never completes. Winserver 2008.


                            Now I wonder if the same file integrity issues might be a factor that explains both problems.


                            Edit note: above link was broken, now fixed.

                            • 11. Re: Script with Print[No Dialog] "remembers" wrong printer



                              The link you supplied is not valid.  Please verify.



                              FileMaker, Inc.