Jump to content

Custom button to print multiple layouts

Gabriel G

This topic is 3000 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hey everyone. Reaching out to the gurus again ;)

I have a situation with printing and I have tried a few things outlined below, but I was hoping someone might offer other suggestions before I go in a completely different direction with this... Ugh

The computers involved are Windows based PCs and they each have a different brand/model of printer. I only tested it with one other PC so far because of this issue.

In case it matters, the related printer is an HP Officejet 6000. It has wireless capabilities, but it is wired to the subject PC.

I have a series of scripts setup to print different layouts based on certain conditions in the interface. Everything works fine from the PC that I'm developing from. So I don't think there is a problem with any of the scripts here...

The problems arise when I try to print from the other PC.

I send a test page to the printer prior to trying a print from within the solution, so I know the printer works.

While trying these print tests, I keep the print queue window in view to observe what is happening.

When the solution is first open (from the other PC), I try using any of the custom print buttons. For a split second, the job(s) show up in the queue, but nothing ever prints.

So, I enable the standard menu and try File...Print with the dialog, it prints the current layout just fine. But this doesn't include any of the necessary child layouts. While it is printing it shows the job in the print queue much longer than described above (until the page is nearly printed).

After printing from the file menu, all of the custom print buttons work fine thereafter. And the jobs stay in the print queue (until the page is nearly printed).

This behavior seems quirky to me... and it repeats this if Filemaker is completely closed.

It seems like it has something to do with this printer or maybe the default printer settings. The help pages mention that Filemaker and Windows both have different default printers and it details how to change it. When I follow those steps from the Print Setup dialog, it shows the same printer that is set as default in Windows which also happens to be the only connected printer. So... I'm puzzled.

My first approach in this solution was using PDF files. Then I switched to sending it straight to the printer which I would prefer to do. The goal is to make it as transparent as possible by simply printing multiple sheets with a single click.

I'd appreciate any suggestions.

Thanks, GG

Link to comment
Share on other sites

I'm guessing, and far from a guru, but I think you figured it out.  Unless you specifically pick a printer in Print Set Up and Print script steps, it will use the default, or the last printer used.  Once you manually selected it, it now becomes the default printer.

I would think you have to hard code the printer in the script steps and use both Print Setup and Print script steps.

There is a plug-in mentioned from time to time on these forums, I think it's called FM Butler that does a better job of this.

Edited by Steve Martino
additional info
Link to comment
Share on other sites

Hi Steve, everyone here is a guru compared to myself. I've been using Filemaker for only a short time now. I guess that was a bad statement to make and probably reduced the number of replies (not my intention).

Thank you for your reply. It sounds like I'm on the right track at least. So, I tried hard coding the printer from the scripts, but it only lists the printers connected to the current machine. I was hoping there was another way or maybe something I was missing to accomplish this.

So the script would need to be setup from each PC that uses the solution. I was afraid of this. It may be time to retrace my steps a bit and use the original plan with PDFs. I wanted to reach out here first before I did, so thank you again for the response.

In the mean time, I'll check out that plug-in too. It may be another option.

Thanks again, GG

Link to comment
Share on other sites

FileMaker remembers the printer last used, as Steve said. But you can store the current print setup in a Print Setup step in a script.

Try this sequence

On each computer, manually set up for the printer it uses.  Then create a script with one step: Print Setup[No dialog] on that machine .  Don't check the "Specify page setup" box. Save this script with a name which identifies the machine. (the script doesn't necessarily need to be created in your solution; any FM file will do, including one you create just for this purpose)

On each computer, use the Get(PersistentID) function to grab the unique FM identifier for that machine.

Import the scripts into your solution on the host machine.

Create a script MachineID:

If[Get(persistentID) = <computer1 persistentID>]
	Perform Script["<computer1 script>"]
Else If[Get(persistentID) = <computer2 persistentID>]
	Perform Script["<computer2 script>"]
End if

Insert a Perform Script["MachineID"] step at the beginning of each of your button scripts.

<rant>This would be a whole lot more scalable if FM allowed you to use field names in the Perform Script[] function </rant>

  • Like 1
Link to comment
Share on other sites

Oh nice. This is along the lines of what I was seeking. I'm not familiar with using the persistentID stuff, so I will look into this a bit. Thank you for chiming in on the conversation too!

3 hours ago, doughemi said:

<rant>This would be a whole lot more scalable if FM allowed you to use field names in the Perform Script[] function </rant>

Glad I'm not the only one who has little gripes about these things. This community makes Filemaker shine beyond any of its short-comings though. B)

3 hours ago, Steve Martino said:

(The 'guru' comment was for my benefit.  I wouldn't want anyone who read my post to think, that I think, I may be one.)

But of course, that is one of the many attributes that qualifies you as a guru.

Thank you all, GG

Link to comment
Share on other sites

This topic is 3000 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.