Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Changing Paper Source During A Script


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

Recommended Posts

  • Newbies
Posted

I am trying to find a way of changing from the paper tray to manual paper feed during a Filemaker script on a Macintosh. I want to print paper from the tray and labels from the manual feed. Do you have any fixes? Thanks in advance.

Posted

The only way that I have found to do this is to create two separate desktop printer (DTP) icons for the same printer. More on that later.

Rename them "Printer-ManualFeed" and "Printer-TrayFeed."

With Printer-ManualFeed set as your default printer, perform a print operation from any application to get into the print dialog. Select the manual feed option and any other print options that you want, then click the Save Settings button. The settings will be saved only for the Printer-ManualFeed DTP, but not the Printer-TrayFeed DTP.

You can do the same thing for the Printer-TrayFeed DTP as well, if you want to save any other specific settings. But, select the tray source rather than manual feed.

Now, by switching printers (ie, different DTP icons) you will be really switching printer settings. To switch DTP's from a script, see this topic: http://www.fmforums.com/ubb/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=8&t=000014

Now, how do you have two different DTP icons for the same printer?

I had thought that you could simply duplicate the icon and rename it, but apparently not. If someone knows how to do this, please let me know.

My workaround is to have two different printer drivers. I use Apple's Laserwriter driver and Adobe's Adobe-PS driver. I set up one DTP with the Laserwriter driver and one with the Adobe driver. They co-exist quite nicely.

Hope this helps.

Posted

One other thought on this. You can use Applescript to change PPD files for your printer. I think you could create different PPD files that give you different default options such as the paper source, number of copies etc. Since PPD files are text files, you can edit them with any text editor. I have never done this but it should be possible. Any brave souls out there?

Posted

Okay, here's just enough postscript to be dangerous.

I figured out how to hack the PPD file to get the printer to use the manual feed slot. Here's how:

1. Make a duplicate of your printer's PPD file. You will find it in the folder, System Folder:Extensions:Printer Definitions.

For Example, the PPD file for my Dataproducts LZR 960 is called "LZR 960." Rename the duplicate "LZR 960MF," so you don't forget that this is a hacked file.

2. Open the duplicate PPD file with a text editor and search for the section of code that begins with "*OpenUI *ManualFeed...."

If it's a Postscript level 1 printer, the code will likely look something like this:

code:


*OpenUI *ManualFeed/Manual Feed: Boolean

*OrderDependency: 20 AnySetup *ManualFeed

*DefaultManualFeed: False

*ManualFeed True: "1 dict dup /ManualFeed true put setpagedevice"

*ManualFeed False: "1 dict dup /ManualFeed False put setpagedevice"

etc.


Change the last line to:

*ManualFeed False: "1 dict dup /ManualFeed True put setpagedevice"

If it's a Postscript level 2 printer, the code will look like this:

code:


*OpenUI *ManualFeed/Manual Feed: Boolean

*OrderDependency: 20 AnySetup *ManualFeed

*DefaultManualFeed: True

*ManualFeed True: "<</ManualFeed true>> setpagedevice"

*ManualFeed False: "<</ManualFeed false>> setpagedevice"

etc.


Change the last line to:

*ManualFeed False: "<</ManualFeed true>> setpagedevice"

3. Save the file.

4. To change to manual feed, execute the following Applescript from your Filemaker script:

code:


set PPDPath to "Macintosh HD:System Folder:Extensions:Printer Descriptions:"

-- Set name of hacked manual feed PPD file

set PPDName to "LZR 960MF"

tell application "Desktop Printer Manager"

set the PPD_file to (PPDPath & PPDName) as string as alias

--My printer is named "Fluffy." Use your own printer name in the following line

set the PPD file of desktop printer "Fluffy" to PPD_file

end tell


To switch back to normal, execute the following:

code:


set PPDPath to "Macintosh HD:System Folder:Extensions:Printer Descriptions:"

--Set name of normal PPD file

set PPDName to "LZR 960"

tell application "Desktop Printer Manager"

set the PPD_file to (PPDPath & PPDName) as string as alias

set the PPD file of desktop printer "Fluffy" to PPD_file

end tell


If your Filemaker script displays the print dialog before it prints, you won't see any difference in the paper source selection, but it will use the manual feed slot no matter which paper source the user selects.

So, be sure to change back to the original PPD file after you are finished manual feed printing, or there will be a lot of confusion in the office.

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