Multiple printers produce unpredictable results - FM10, XP Pro
Description of the issue
Problem: Inconsistent printing using multiple printers with scriptsSystem: FM10 Pro and AdvancedOS: XP Pro I have an application that uses three different printers for various reports, labels, barcodes, receipts, etc. One of the three also needs to print in both landscape and portrait, depending on the item being printed. All printing is done without dialog using scripts. The users of the application do not have time to select a printer, paper, format, etc. I've tried scripting this a million ways, with none working. This is how it is right now and it works some of the time: I have a separate script for each printer and two for landscape and portrait on the dual purpose printer. I call the script with a layout of what I want to print in browse mode. Each script does a 'print preview' with no dialog and a setting appropriate for the printer and form. It then goes to preview mode and does a print with no dialog.It works for a while, but sooner or later either landscape or portrait becomes the only way that the scripts will print. In some cases the output goes to the wrong printer. In other cases, the paper size or landscape/portrait change is ignored or carried over to the next print operation on a different printer. One real bug that causes severe problems is when the paper size is too small when entering preview mode (in spite of the print preview being entered correctly - I think) and a modal dialog box comes up with an error message. It has a cancel button which does nothing. The only way that I can get it to go away is to quit Filemaker. It came up once during a script debugging session and I had to bring up the windows task manager to shut filemaker down. I've tried a few plugins. MyFMButler seems to get it all right except for the landscape/portrait problem. I haven't tried their capture-restore function since it is Windows only and I'd love to keep this compatible with Macs since we have both in the shop. I've also tried a few vbscripts and the PRINTUI DLL . I've changed the default printer with scripting. I've saved a specific configuration of paper and portrait/landscape. No matter. It still fails. Again, I'd rather not use a windows specific solution unless I really have to. What I'd really like to know is how it is supposed to work. These may sound like dumb questions, but I can't find examples or documentation that tells me the story: 1. Do you have to go to preview mode to get proper printing using a script? If so, does the 'enter preview mode' script command have any effect on the printer, printer paper, or format - other than bringing up error messages about headers and footers being too big? It seems to know something about the print format and paper size and it does change if I bring up the menu (File/Print Preview)directly - without scripting. Should the 'Enter Preview mode' statement come after the 'Print Preview' statement? 2. The documentation says that 'Print Preview' and 'Print' script commands retain their 'specified print options'. Does this stickiness occur during the script process or does it happen when the script is executed? Should I duplicate the print options in the matched 'Print Preview' and 'Print' script commands or should I just set them in the 'Print Preview' and have the Print just have the 'no dialog' option? 3. If I just perform a 'Print[No Dialog]" does this use the windows default printer? or does it use the printer that was the default upon entering Filemaker? (I noticed that Filemaker does keep a 'printer' entry in the preferences in the windows register.) or does it use the last printer used? Or something else??? 4. Some wag mentioned that not only should you keep separate scripts for each printer and mode ( did that), but that you need to keep these scripts in separate files! If this is a solution, then I'd do it, but I have a zillion different tables that are linked together and I'd have to reference them all and move a layout or two into the files, as well. This is worth it if it will solve the problem, but if there is a simpler way, please let me know. Please, please, please, can anybody supply some example of multiple format and multiple printer scripts that work in FM10 on both Macs and PCs? If there are more of you with similar problems, please chime in. I don't know if I am coping with a bug or if some decent documentation on how all these things interact would make everything work. I'd love to have it be the latter, so Filemaker moderators - if you have some decent documentation, please let me know.