Jump to content

The Print [Restore:...] command


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

Recommended Posts

  • Newbies

Greetings,

This is something I've noticed for a long time and wanted to see if anyone had any confirmation on if this is something to worry about or not. I suspect not but wanted to double check as I don't have a second printer lying around and this has to do with creating a script on site X, then deploying to site Y which has a totally different printer setup.

The question is that in writing scripts, when you add the "Print [Restore]" command, Filemaker takes the name of the currently selected printer. So when you run your DB on another system, does the script inherently change the printer to that of a currently selected Default printer? ...or better yet, is there a way TO just assume a "Default Printer" or will it just do that itself once it can't find the printer in the script.

I guess the main problem is that I'm trying to parse records WHILE they're printing to I can send them to the appropriate layout for proper printing. Unfortunately, you can't just do your search, then do a Print Setup, Print as obviously that will just print ALL of the found set with the previously selected layout. Instead I'm doing this to choose between two layouts:

Loop

If [Field::Name = "check one" or Field::Name = "check two"]

Go to Layout ["Layout 1"]

Print Setup [Restore; No dialog]

Print [Restore: <my personal printer name - can't get rid of this>; No dialog]

End If

If [Field::Name = "check three" or Field::Name = "check four"]

Go to Layout ["Layout 2"]

Print Setup [Restore; No dialog]

Print [Restore: <my personal printer name - can't get rid of this>; No dialog]

End If

Go to Record/Request/Page [Next; Exit after last]

End Loop

The issue with this is that the "No Dialog" in the Print is necessary as without it, a 32 page report will require someone at their computer to hit RETURN 32 times as it will pop up the print dialog box :P

To get around this, I turned off the dialog but now that means you can't set the printer, hence, hoping it will just default to the windows MAIN PRINTER.

Of course, NOW the Page Numbers are wacked... Not even showing page numbers but this weird #00D784 and never changes.

If anyone knows of a better way to do something like this and it keeps the page numbers correct, etc, I'm all eyes yet I think the way around the page #'s is to just use a global var increased in the loop.

Link to comment
Share on other sites

On Mac OS I believe it can be said the default printer will be used if nothing else is selected. This, however, doesn't in itself solve the problem if you have a label printer, cheque printer and a colour printer. It's possible to create a truly dynamic printing environment, and I've done it. Much of the code was posted on FileMaker Forums. It's very involved and not for the faint of heart. As well, my system is Mac only as it uses calculated Applescripts and UNIX extensively. It can be done. I can't tell from your post which OS you're using.

RW

Link to comment
Share on other sites

  • Newbies

On Mac OS I believe it can be said the default printer will be used if nothing else is selected. This, however, doesn't in itself solve the problem if you have a label printer, cheque printer and a colour printer. It's possible to create a truly dynamic printing environment, and I've done it. Much of the code was posted on FileMaker Forums. It's very involved and not for the faint of heart. As well, my system is Mac only as it uses calculated Applescripts and UNIX extensively. It can be done. I can't tell from your post which OS you're using.

RW

Using Windows but clients can be either as client is serving via FMPro Server on a Windows box.

I'm pretty sure if a default printer will be used clientside if selected script printer is not there - I'm just surprised you can't delegate in the scripting to use 'Default Printer' specifically as opposed to it locking in whatever printer is used on the development system.

I can see how some advanced scripting can be used to choose a printer - It's just an odd situation I have where a group of selected records EACH has to be delegated to a potentially different print layout and it seems you must decode such logic in a: CHOOSE RECORD -> CHOOSE LAYOUT -> PRINT -> REPEAT rather then SCAN RECORDS -> ATTACH LAYOUT TAG TO EACH RECORD -> THEN PRINT ALL RECORDS AT ONCE.

As for the Page Numbers, yea, global var fixed that and there was no strange numbers, they were just off the page - my client has an edge to edge printer and so it was off the page. I was seeing a different number.

Link to comment
Share on other sites

This topic is 4798 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.